From 234e37175bedd061252a311cc3d08f4898132aae Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sun, 13 Nov 2022 22:59:21 +0100 Subject: flake: interface modules and overlays --- flake.nix | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 6ca1663..ac3ee30 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,41 @@ { - inputs.personal-webpage = { - url = "github:qaristote/webpage"; - inputs.nixpkgs.follows = ""; + inputs = { + personal-webpage = { + url = "github:qaristote/webpage"; + inputs = { + nixpkgs.follows = "/nixpkgs"; + flake-utils.follows = "/flake-utils"; + }; + }; }; - outputs = { self, nixpkgs, ... }@attrs: { - nixosConfigurations = { - hermes = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = attrs; - modules = [ ./configuration.nix ./hardware-configuration.nix ]; + 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}"; + }; }; - hermes-test = nixpkgs.lib.nixosSystem { + }) // { + nixosModules.default = import ./modules; + nixosConfigurations = let system = "x86_64-linux"; specialArgs = attrs; - modules = [ ./tests/configuration.nix ]; + 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 ]; + }; }; }; - }; } -- cgit v1.2.3