diff --git a/home/features/coding/#nix.nix# b/home/features/coding/#nix.nix# new file mode 100644 index 0000000..1be7c7c --- /dev/null +++ b/home/features/coding/#nix.nix# @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + appimage-run + deploy-rs + nil + nix-prefetch-git + nixfmt + rnix-lsp + ]; +} diff --git a/home/features/coding/nix.nix b/home/features/coding/nix.nix index 67f4874..1be7c7c 100644 --- a/home/features/coding/nix.nix +++ b/home/features/coding/nix.nix @@ -6,5 +6,6 @@ nil nix-prefetch-git nixfmt + rnix-lsp ]; } diff --git a/home/features/desktop/media.nix b/home/features/desktop/media.nix index 5de5150..ca43ae7 100644 --- a/home/features/desktop/media.nix +++ b/home/features/desktop/media.nix @@ -11,7 +11,7 @@ in { config = mkIf cfg.enable { home.packages = with pkgs; [ - ffmpeg + ffmpeg_6-full fractal frei0r gphoto2 diff --git a/home/features/desktop/office.nix b/home/features/desktop/office.nix index 6d26086..0d32029 100644 --- a/home/features/desktop/office.nix +++ b/home/features/desktop/office.nix @@ -14,6 +14,7 @@ in { nextcloud-client libreoffice neomutt + pdftk tutanota-desktop okular zathura diff --git a/home/features/desktop/wofi.nix b/home/features/desktop/wofi.nix index 466a4be..cbeb969 100644 --- a/home/features/desktop/wofi.nix +++ b/home/features/desktop/wofi.nix @@ -6,7 +6,7 @@ in { home.packages = [ pkgs.wofi - bemoji - wofi-pass - ]; + kgs.be +m wofi-pass + ]; } diff --git a/hosts/common/base/default.nix b/hosts/common/base/default.nix index 217b185..5fbc563 100644 --- a/hosts/common/base/default.nix +++ b/hosts/common/base/default.nix @@ -7,5 +7,5 @@ users.defaultUserShell = pkgs.fish; environment.systemPackages = - [ inputs.agenix.packages.x86_64-linux.default pkgs.busybox ]; + [ inputs.agenix.packages.x86_64-linux.default pkgs.coreutils ]; } diff --git a/hosts/common/users/m3tam3re/default.nix b/hosts/common/users/m3tam3re/default.nix index 875976c..ae85608 100644 --- a/hosts/common/users/m3tam3re/default.nix +++ b/hosts/common/users/m3tam3re/default.nix @@ -4,12 +4,23 @@ "$y$j9T$wOKc3kLsQVtmmyLIN7ljV.$NvdWzwn6p8JNByHoXQqf6/GF3C0JOPHW/D0HgFLQXy4"; isNormalUser = true; description = "m3tam3re"; - extraGroups = [ "wheel" "networkmanager" "libvirtd" "flatpak" "audio" "video" "input"]; + extraGroups = [ + "wheel" + "networkmanager" + "libvirtd" + "flatpak" + "audio" + "video" + "input" + "kvm" + "qemu-libvirtd" + ]; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3YEmpYbM+cpmyD10tzNRHEn526Z3LJOzYpWEKdJg8DaYyPbDn9iyVX30Nja2SrW4Wadws0Y8DW+Urs25/wVB6mKl7jgPJVkMi5hfobu3XAz8gwSdjDzRSWJrhjynuaXiTtRYED2INbvjLuxx3X8coNwMw58OuUuw5kNJp5aS2qFmHEYQErQsGT4MNqESe3jvTP27Z5pSneBj45LmGK+RcaSnJe7hG+KRtjuhjI7RdzMeDCX73SfUsal+rHeuEw/mmjYmiIItXhFTDn8ZvVwpBKv7xsJG90DkaX2vaTk0wgJdMnpVIuIRBa4EkmMWOQ3bMLGkLQeK/4FUkNcvQ/4+zcZsg4cY9Q7Fj55DD41hAUdF6SYODtn5qMPsTCnJz44glHt/oseKXMSd556NIw2HOvihbJW7Rwl4OEjGaO/dF4nUw4c9tHWmMn9dLslAVpUuZOb7ykgP0jk79ldT3Dv+2Hj0CdAWT2cJAdFX58KQ9jUPT3tBnObSF1lGMI7t77VU= m3tam3re@m3-nix" ]; packages = [ pkgs.home-manager ]; }; - home-manager.users.m3tam3re = import m3tam3re/${config.networking.hostName}.nix; + home-manager.users.m3tam3re = + import m3tam3re/${config.networking.hostName}.nix; } diff --git a/hosts/lkk-nix-1/services/traefik.nix b/hosts/lkk-nix-1/services/traefik.nix index 5e3f985..3308776 100644 --- a/hosts/lkk-nix-1/services/traefik.nix +++ b/hosts/lkk-nix-1/services/traefik.nix @@ -145,6 +145,15 @@ service = "matomo"; entrypoints = "websecure"; }; + matomo-m3tam3re = { + rule = "Host(`stats.m3tam3re.com`)"; + tls = { + certResolver = "lets-encrypt"; + domains = "stats.m3tam3re.com"; + }; + service = "matomo"; + entrypoints = "websecure"; + }; minio = { rule = "Host(`s3.lanakk.com`)"; tls = { @@ -270,6 +279,6 @@ }; systemd.services.traefik.serviceConfig = { - EnvironmentFile = "${config.age.secrets.traefik-env.path}"; + EnvironmentFile = [ "${config.age.secrets.traefik-env.path}" ]; }; } diff --git a/hosts/m3-nix/default.nix b/hosts/m3-nix/default.nix index 112e838..86099c7 100644 --- a/hosts/m3-nix/default.nix +++ b/hosts/m3-nix/default.nix @@ -16,12 +16,14 @@ in { imports = [ ./hardware.nix ./hardware-configuration.nix # Include the results of the hardware scan. + ./vfio.nix ../common/users/m3tam3re ../common/base ./services ]; + specialisation = { - external-display.configuration = { + "EX-Display".configuration = { system.nixos.tags = [ "Externer-Monitor" ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.prime.offload.enable = lib.mkForce false; @@ -29,7 +31,7 @@ in { }; }; specialisation = { - dual-display.configuration = { + "DUAL-Display".configuration = { system.nixos.tags = [ "Dual-Monitor" ]; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.prime.offload.enable = lib.mkForce false; @@ -37,7 +39,12 @@ in { hardware.nvidia.powerManagement.finegrained = lib.mkForce false; }; }; - + specialisation = { + "VFIO".configuration = { + system.nixos.tags = [ "GPU-passthrough" ]; + vfio.enable = true; + }; + }; # Bootloader. # boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/hosts/m3-nix/services/virtualization.nix b/hosts/m3-nix/services/virtualization.nix index 91ff9aa..bae02a4 100644 --- a/hosts/m3-nix/services/virtualization.nix +++ b/hosts/m3-nix/services/virtualization.nix @@ -1,10 +1,19 @@ -{ - virtualisation.libvirtd.enable = true; - virtualisation.libvirtd.qemu.swtpm.enable = true; - virtualisation.libvirtd.qemu.ovmf.enable = true; - virtualisation.podman = { - enable = true; - enableNvidia = true; - defaultNetwork.settings.dns_enabled = true; +{ pkgs, ... }: { + virtualisation = { + libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + ovmf = { + enable = true; + packages = [ pkgs.OVMFFull ]; + }; + }; + }; + podman = { + enable = true; + enableNvidia = true; + defaultNetwork.settings.dns_enabled = true; + }; }; } diff --git a/hosts/m3-nix/vfio.nix b/hosts/m3-nix/vfio.nix new file mode 100644 index 0000000..19f4ffc --- /dev/null +++ b/hosts/m3-nix/vfio.nix @@ -0,0 +1,31 @@ +let + gpuIDs = [ + "10de:249d" # Graphics + "10de:228b" # Audio + ]; +in { pkgs, lib, config, ... }: { + options.vfio.enable = with lib; + mkEnableOption "Configure the machine for VFIO"; + + config = let cfg = config.vfio; + in { + boot = { + initrd.kernelModules = [ + "vfio_pci" + "vfio" + "vfio_iommu_type1" + "vfio_virqfd" + ]; + + kernelParams = [ + # enable IOMMU + "intel_iommu=on" + ] ++ lib.optional cfg.enable + # isolate the GPU + ("vfio-pci.ids=" + lib.concatStringsSep "," gpuIDs); + }; + + hardware.opengl.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + }; +} diff --git a/hosts/m3-nix/vfio.nix.~1~ b/hosts/m3-nix/vfio.nix.~1~ new file mode 100644 index 0000000..e69de29