From 70a9348fa611bac6e9c0602b899a9afe9578bd2e Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 2 Mar 2024 09:34:45 +0100 Subject: [PATCH] switch pc to unstable, use kde 6 --- flake.lock | 22 ++++++++++++++++++++++ flake.nix | 15 ++++++++++++--- modules/graphical/plasma.nix | 2 +- modules/hardware/vfio.nix | 6 ++++++ modules/nix/settings.nix | 4 ++-- systems/pc/userdata.nix | 5 ++++- 6 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 modules/hardware/vfio.nix diff --git a/flake.lock b/flake.lock index 59549e5..1860631 100644 --- a/flake.lock +++ b/flake.lock @@ -114,6 +114,27 @@ "type": "github" } }, + "home-manager-unstable": { + "inputs": { + "nixpkgs": [ + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1709204054, + "narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2f3367769a93b226c467551315e9e270c3f78b15", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, "home-manager_2": { "inputs": { "nixpkgs": [ @@ -258,6 +279,7 @@ "inputs": { "agenix": "agenix", "home-manager": "home-manager_2", + "home-manager-unstable": "home-manager-unstable", "nix-colors": "nix-colors", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", diff --git a/flake.nix b/flake.nix index 520578c..45b9eea 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,10 @@ url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager-unstable = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; nixos-wsl = { url = "github:nix-community/NixOS-WSL"; inputs.nixpkgs.follows = "nixpkgs"; @@ -23,6 +27,7 @@ nixpkgs-unstable, agenix, home-manager, + home-manager-unstable, nix-colors, }@inputs: let @@ -77,13 +82,15 @@ specialArgs = { ## Custom variables (e.g. ip, interface, etc) vars = import ./systems/userdata-default.nix // import ./systems/server/userdata.nix; + pkgsVersion = nixpkgs; inherit inputs ; }; }; - nixosConfigurations."kop-pc" = nixpkgs.lib.nixosSystem { + nixosConfigurations."kop-pc" = nixpkgs-unstable.lib.nixosSystem { inherit system; specialArgs = { vars = import ./systems/userdata-default.nix // import ./systems/pc/userdata.nix; + pkgsVersion = nixpkgs-unstable; inherit inputs ; }; modules = [ @@ -110,7 +117,8 @@ ./modules/nix/ld.nix ./modules/cli-tools.nix ./modules/gpg.nix - #./modules/virt-manager.nix dont need atm + ./modules/virt-manager.nix + #./modules/hardware/vfio.nix too stupid for this ./modules/flatpak.nix ./modules/docker.nix ./modules/nftables.nix @@ -122,7 +130,7 @@ ./modules/support/ntfs.nix ./systems/pc/configuration.nix agenix.nixosModules.default - home-manager.nixosModules.home-manager + home-manager-unstable.nixosModules.home-manager ]; }; nixosConfigurations."nix-laptop" = nixpkgs.lib.nixosSystem { @@ -130,6 +138,7 @@ specialArgs = { ## Custom variables (e.g. ip, interface, etc) vars = import ./systems/userdata-default.nix // import ./systems/laptop/userdata.nix; + pkgsVersion = nixpkgs; inherit inputs; inherit nix-colors; }; diff --git a/modules/graphical/plasma.nix b/modules/graphical/plasma.nix index 4c88c40..16d3033 100644 --- a/modules/graphical/plasma.nix +++ b/modules/graphical/plasma.nix @@ -6,6 +6,6 @@ xkbVariant = ""; enable = true; displayManager.sddm.enable = true; - desktopManager.plasma5.enable = true; + desktopManager.plasma6.enable = true; }; } diff --git a/modules/hardware/vfio.nix b/modules/hardware/vfio.nix new file mode 100644 index 0000000..115c500 --- /dev/null +++ b/modules/hardware/vfio.nix @@ -0,0 +1,6 @@ +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.virtualisation.libvirtd.enable { + boot.kernelParams = [ "amd_iommu=on" ]; + }; +} diff --git a/modules/nix/settings.nix b/modules/nix/settings.nix index a7d33b8..ec16aae 100644 --- a/modules/nix/settings.nix +++ b/modules/nix/settings.nix @@ -1,8 +1,8 @@ -{ inputs, config, ... }: +{ inputs, config, pkgsVersion, ... }: { nix.optimise.automatic = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.registry.nixpkgs.flake = inputs.nixpkgs; + nix.registry.nixpkgs.flake = pkgsVersion; nix.nixPath = ["nixpkgs=flake:nixpkgs"]; home-manager.users.${config.mainUser.name}.home.sessionVariables.NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}"; } diff --git a/systems/pc/userdata.nix b/systems/pc/userdata.nix index 604dc9d..5291ae3 100644 --- a/systems/pc/userdata.nix +++ b/systems/pc/userdata.nix @@ -1,4 +1,7 @@ { - +# IOMMU Group 16 2b:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA102 [GeForce RTX 3090] [10de:2204] (rev a1) +# IOMMU Group 16 2b:00.1 Audio device [0403]: NVIDIA Corporation GA102 High Definition Audio Controller [10de:1aef] (rev a1) + gpu_vga = "10de:2204"; + gpu_audio = "10de:1aef"; }