diff --git a/flake.lock b/flake.lock index 2bfa7101..dec65deb 100644 --- a/flake.lock +++ b/flake.lock @@ -80,7 +80,7 @@ "home-manager": { "inputs": { "nixpkgs": [ - "unstable-nixpkgs" + "nixpkgs" ] }, "locked": { @@ -104,7 +104,7 @@ "flake-parts": "flake-parts", "flake-utils": "flake-utils", "nixpkgs": [ - "unstable-nixpkgs" + "nixpkgs" ], "pre-commit-hooks-nix": "pre-commit-hooks-nix" }, @@ -122,36 +122,19 @@ "type": "github" } }, - "nixos-hardware": { - "locked": { - "lastModified": 1691871742, - "narHash": "sha256-6yDNjfbAMpwzWL4y75fxs6beXHRANfYX8BNSPjYehck=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "430a56dd16fe583a812b2df44dca002acab2f4f6", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1691853136, - "narHash": "sha256-wTzDsRV4HN8A2Sl0SVQY0q8ILs90CD43Ha//7gNZE+E=", + "lastModified": 1692638711, + "narHash": "sha256-J0LgSFgJVGCC1+j5R2QndadWI1oumusg6hCtYAzLID4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f0451844bbdf545f696f029d1448de4906c7f753", + "rev": "91a22f76cd1716f9d0149e8a5c68424bb691de15", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" } }, "nixpkgs-stable": { @@ -186,6 +169,22 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1691853136, + "narHash": "sha256-wTzDsRV4HN8A2Sl0SVQY0q8ILs90CD43Ha//7gNZE+E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f0451844bbdf545f696f029d1448de4906c7f753", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1692070330, @@ -236,15 +235,14 @@ "inputs": { "home-manager": "home-manager", "lanzaboote": "lanzaboote", - "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", "nur": "nur", - "sops-nix": "sops-nix", - "unstable-nixpkgs": "unstable-nixpkgs" + "sops-nix": "sops-nix" } }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { @@ -275,21 +273,6 @@ "repo": "default", "type": "github" } - }, - "unstable-nixpkgs": { - "locked": { - "lastModified": 1691990649, - "narHash": "sha256-gMbKOiX1HwClRP9lADaaV/lnZr93NEaOFe4ApDx/zd8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6e287913f7b1ef537c97aa301b67c34ea46b640f", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-unstable", - "type": "indirect" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3055f3d9..34d5c514 100644 --- a/flake.nix +++ b/flake.nix @@ -19,12 +19,12 @@ libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; }; in { nixosConfigurations = { - nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; }; - nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; }; + nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; graphics="intel" }; + nixos-desktop = libx.mkHost { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; graphics="nvidia" }; }; homeConfigurations = { "albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; username = "albert"; desktop = "hyprland"; }; "albert@nixos-desktop" = libx.mkHome { hostname = "nixos-desktop"; username = "albert"; desktop = "gnome"; }; }; }; -} \ No newline at end of file +} diff --git a/lib/default.nix b/lib/default.nix index 3b0edf21..cc47fc24 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -10,7 +10,7 @@ }; # Helper function for generating host configs - mkHost = { hostname, username, desktop ? null, installer ? null }: inputs.nixpkgs.lib.nixosSystem { + mkHost = { hostname, username, desktop ? null, installer ? null, graphics ? "nvidia" }: inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs desktop hostname username stateVersion; }; @@ -29,4 +29,4 @@ "aarch64-darwin" "x86_64-darwin" ]; -} \ No newline at end of file +} diff --git a/nixos/common/desktops/gnome/default.nix b/nixos/common/desktops/gnome/default.nix index 2c805d03..9ac6f2a2 100644 --- a/nixos/common/desktops/gnome/default.nix +++ b/nixos/common/desktops/gnome/default.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, hostname, ... }: { +{ lib, config, pkgs, hostname, graphics, ... }: { # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; @@ -17,7 +17,7 @@ xkbVariant = ""; autorun = true; # When you play games, change this to nvidia - videoDrivers = [ "intel" ]; + videoDrivers = [ "${graphics}" ]; }; ##### disable nvidia, very nice battery life. diff --git a/nixos/common/desktops/hyprland/default.nix b/nixos/common/desktops/hyprland/default.nix index 6bcfe361..7f1d9af6 100644 --- a/nixos/common/desktops/hyprland/default.nix +++ b/nixos/common/desktops/hyprland/default.nix @@ -1,5 +1,5 @@ -{pkgs, ...}: { - services.xserver.videoDrivers = ["nvidia"]; +{pkgs, graphics, ...}: { + services.xserver.videoDrivers = [ "${graphics}" ]; # tuigreet services.greetd = { @@ -77,4 +77,4 @@ pulse.enable = true; jack.enable = true; }; -} \ No newline at end of file +}