diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 116 |
1 files changed, 68 insertions, 48 deletions
diff --git a/flake.nix b/flake.nix index 0e2c00d..b8e1a8f 100644 --- a/flake.nix +++ b/flake.nix @@ -23,54 +23,74 @@ flake-compat.url = "github:edolstra/flake-compat"; }; - outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, agenix, home-manager, nix-vscode-extensions, ... }: - let - system = "x86_64-linux"; - - machines = [ - "graphite" - "bismuth" - ]; - - overlays = [ - agenix.overlays.default - nix-vscode-extensions.overlays.default - ]; - - packageSets = let - commonPkgsInputs = { inherit system; config = import ./config.nix; }; - in rec { - pkgs = import nixpkgs (commonPkgsInputs // { inherit overlays; }); - - unstablePkgs = import nixpkgs-unstable commonPkgsInputs; - - auxiliaryPkgs = import ./pkgs { inherit pkgs unstablePkgs; }; - }; - - in { - nixosConfigurations = nixpkgs.lib.genAttrs machines - (machine: nixpkgs.lib.nixosSystem { - inherit system; - - specialArgs = inputs // packageSets // { - me = machine; + outputs = + inputs@{ + self, + nixpkgs, + nixpkgs-unstable, + agenix, + home-manager, + nix-vscode-extensions, + ... + }: + let + system = "x86_64-linux"; + + machines = [ + "graphite" + "bismuth" + ]; + + overlays = [ + agenix.overlays.default + nix-vscode-extensions.overlays.default + ]; + + packageSets = + let + commonPkgsInputs = { + inherit system; + config = import ./config.nix; + }; + in + rec { + pkgs = import nixpkgs (commonPkgsInputs // { inherit overlays; }); + + unstablePkgs = import nixpkgs-unstable commonPkgsInputs; + + auxiliaryPkgs = import ./pkgs { inherit pkgs unstablePkgs; }; }; - modules = [ - ./machines/${machine} - - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.mel = import ./machines/${machine}/home.nix; - } - - agenix.nixosModules.default - ]; - } - ); - - # compatibility wrapper for nixos-option - legacyPackages.${system} = with packageSets; pkgs.recurseIntoAttrs pkgs; - }; + in + { + nixosConfigurations = nixpkgs.lib.genAttrs machines ( + machine: + nixpkgs.lib.nixosSystem { + inherit system; + + specialArgs = + inputs + // packageSets + // { + me = machine; + }; + + modules = [ + ./machines/${machine} + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.mel = import ./machines/${machine}/home.nix; + } + + agenix.nixosModules.default + ]; + } + ); + + # compatibility wrapper for nixos-option + legacyPackages.${system} = with packageSets; pkgs.recurseIntoAttrs pkgs; + }; } |
