From 33e8f27b119c53de47e431e8b03c355cca719ddd Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 15 Dec 2024 14:09:58 -0500 Subject: [PATCH] flake: move nixpkgs config to flake --- common/nix.nix | 10 +--------- flake.nix | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/common/nix.nix b/common/nix.nix index 8476eb1b..64cd89ab 100644 --- a/common/nix.nix +++ b/common/nix.nix @@ -1,4 +1,4 @@ -{self, ...}: { +{...}: { nix = { gc = { automatic = true; @@ -36,12 +36,4 @@ trusted-users = ["aly"]; }; }; - - nixpkgs = { - config.allowUnfree = true; # Allow unfree packages - overlays = [ - self.inputs.nur.overlays.default - self.overlays.default - ]; - }; } diff --git a/flake.nix b/flake.nix index 1bfc0708..d6e0e09b 100644 --- a/flake.nix +++ b/flake.nix @@ -79,13 +79,19 @@ forAllLinuxSystems = f: self.inputs.nixpkgs.lib.genAttrs allLinuxSystems (system: f { - pkgs = import self.inputs.nixpkgs {inherit system;}; + pkgs = import self.inputs.nixpkgs { + inherit overlays system; + config.allowUnfree = true; + }; }); forAllSystems = f: self.inputs.nixpkgs.lib.genAttrs allSystems (system: f { - pkgs = import self.inputs.nixpkgs {inherit system;}; + pkgs = import self.inputs.nixpkgs { + inherit overlays system; + config.allowUnfree = true; + }; }); forAllHosts = self.inputs.nixpkgs.lib.genAttrs [ @@ -96,6 +102,11 @@ "rustboro" "slateport" ]; + + overlays = [ + self.inputs.nur.overlays.default + self.overlays.default + ]; in { devShells = forAllLinuxSystems ({pkgs}: { default = pkgs.mkShell { @@ -127,11 +138,8 @@ "aly@petalburg" = self.inputs.home-manager.lib.homeManagerConfiguration { extraSpecialArgs = {inherit self;}; pkgs = import self.inputs.nixpkgs { - overlays = [ - self.inputs.nur.overlays.default - self.overlays.default - ]; - + inherit overlays; + config.allowUnfree = true; # Allow unfree packages system = "x86_64-linux"; }; @@ -184,6 +192,7 @@ host: self.inputs.nixpkgs.lib.nixosSystem { specialArgs = {inherit self;}; + modules = [ ./hosts/${host} self.inputs.agenix.nixosModules.default @@ -200,6 +209,11 @@ useGlobalPkgs = true; useUserPackages = true; }; + + nixpkgs = { + inherit overlays; + config.allowUnfree = true; + }; } ]; }