diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-02-18 14:31:33 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-02-18 14:42:41 +0100 |
| commit | 093cb612282f48d15ba295f109660e47a22f8e39 (patch) | |
| tree | 68d61e95578bccb71f0da0d9e451c5d022d6910d /flake.nix | |
| parent | ceb94dc2b322212ee3622927f5f4c289c04a798e (diff) | |
factor out common configuration options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 51 |
1 files changed, 21 insertions, 30 deletions
@@ -2,40 +2,31 @@ inputs = { personal-webpage = { url = "github:qaristote/webpage"; - inputs = { - nixpkgs.follows = "/nixpkgs"; - flake-utils.follows = "/flake-utils"; - }; + inputs.nixpkgs.follows = "/nixpkgs"; }; + my-nixpkgs.url = "git+file:///home/qaristote/code/nix/my-nixpkgs"; }; - outputs = { self, nixpkgs, personal-webpage, flake-utils, ... }@attrs: - flake-utils.lib.eachDefaultSystem (system: { - overlays.default = final: prev: { - personal = import ./pkgs { pkgs = final; } // { - webpage = personal-webpage.defaultPackage."${system}"; - }; + outputs = { self, nixpkgs, my-nixpkgs, personal-webpage, ... }: { + nixosConfigurations = let + system = "x86_64-linux"; + commonModules = [ + my-nixpkgs.nixosModules.personal + ({ ... }: { + nixpkgs.overlays = + [ my-nixpkgs.overlays.personal personal-webpage.overlays.default ]; + }) + ]; + in { + hermes = nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules + ++ [ ./config ./config/hardware-configuration.nix ]; }; - }) // { - nixosModules.default = import ./modules; - nixosConfigurations = let - system = "x86_64-linux"; - specialArgs = attrs; - commonModules = [ - self.nixosModules.default - ({ ... }: { - nixpkgs.overlays = [ self.overlays."${system}".default ]; - }) - ]; - in { - hermes = nixpkgs.lib.nixosSystem { - inherit system specialArgs; - modules = commonModules ++ [ ./config ./hardware-configuration.nix ]; - }; - hermes-test = nixpkgs.lib.nixosSystem { - inherit system specialArgs; - modules = commonModules ++ [ ./tests/configuration.nix ]; - }; + hermes-test = nixpkgs.lib.nixosSystem { + inherit system; + modules = commonModules ++ [ ./tests/configuration.nix ]; }; }; + }; } |
