diff options
| author | seth <[email protected]> | 2024-02-04 16:07:57 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-04 16:07:57 -0500 |
| commit | 80321e46cbd2e436aa4b1c0edfcd5de2c71abcd0 (patch) | |
| tree | 349bd26cd6ad7d3e50c7d2e59bfb11ebb20ad1cd | |
| parent | cde5f27792b28aebde995d78d157ad0041d7018c (diff) | |
flakeModules/configurations: import nixos/darwin modules by default
| -rw-r--r-- | dev/checks.nix | 4 | ||||
| -rw-r--r-- | flake.nix | 12 | ||||
| -rw-r--r-- | modules/flake/configurations.nix | 2 | ||||
| -rw-r--r-- | modules/shared/suites/personal.nix | 2 | ||||
| -rw-r--r-- | systems/default.nix (renamed from configs.nix) | 28 | ||||
| -rw-r--r-- | terranix/default.nix | 2 | ||||
| -rw-r--r-- | users/default.nix | 12 |
7 files changed, 29 insertions, 33 deletions
diff --git a/dev/checks.nix b/dev/checks.nix index 35cd535..cf2b732 100644 --- a/dev/checks.nix +++ b/dev/checks.nix @@ -1,6 +1,4 @@ -{inputs, ...}: { - imports = [inputs.pre-commit.flakeModule]; - +{ perSystem = {self', ...}: { pre-commit = { settings.hooks = { @@ -6,14 +6,20 @@ extra-trusted-public-keys = ["getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="]; }; - outputs = {parts, ...} @ inputs: - parts.lib.mkFlake {inherit inputs;} { + outputs = inputs: + inputs.parts.lib.mkFlake {inherit inputs;} { imports = [ - ./configs.nix ./dev ./modules ./overlay + ./systems + ./users ./terranix + + inputs.pre-commit.flakeModule + # dogfooding + ./modules/flake/configurations.nix + ./modules/flake/terranix.nix ]; systems = [ diff --git a/modules/flake/configurations.nix b/modules/flake/configurations.nix index 7980b8a..6cbe2cb 100644 --- a/modules/flake/configurations.nix +++ b/modules/flake/configurations.nix @@ -3,6 +3,7 @@ lib, withSystem, inputs, + self, ... }: let namespace = "configurations"; @@ -48,6 +49,7 @@ ../../systems/${name} {networking.hostName = name;} ] + ++ lib.attrValues self."${type}Modules" ++ cfg.${type}.modules ++ args.modules; diff --git a/modules/shared/suites/personal.nix b/modules/shared/suites/personal.nix index 3c5146a..1a9278a 100644 --- a/modules/shared/suites/personal.nix +++ b/modules/shared/suites/personal.nix @@ -10,6 +10,6 @@ in { }; config = lib.mkIf cfg.enable { - users.seth.enable = true; + users.seth.enable = lib.mkDefault true; }; } diff --git a/configs.nix b/systems/default.nix index de3cec7..964df12 100644 --- a/configs.nix +++ b/systems/default.nix @@ -1,35 +1,15 @@ { - lib, withSystem, inputs, - self, ... -}: let - mkModulesFor = type: extra: - lib.concatLists [ - (lib.attrValues self."${type}Modules") - extra - ]; -in { - imports = [ - ./systems/deploy.nix - ./modules/flake/configurations.nix - ]; +}: { + imports = [./deploy.nix]; configurations = { - home = { - builder = inputs.hm.lib.homeManagerConfiguration; - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - - users = { - seth = {}; - }; - }; - nixos = { builder = inputs.nixpkgs.lib.nixosSystem; - modules = mkModulesFor "nixos" [ + modules = [ inputs.agenix.nixosModules.default inputs.hm.nixosModules.home-manager ]; @@ -49,7 +29,7 @@ in { darwin = { builder = inputs.darwin.lib.darwinSystem; - modules = mkModulesFor "darwin" [ + modules = [ inputs.hm.darwinModules.home-manager ]; diff --git a/terranix/default.nix b/terranix/default.nix index 12bf013..b27e23d 100644 --- a/terranix/default.nix +++ b/terranix/default.nix @@ -1,6 +1,4 @@ {inputs, ...}: { - imports = [../modules/flake/terranix.nix]; - perSystem = {pkgs, ...}: { terranix = { builder = inputs.terranix.lib.terranixConfiguration; diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..dcfc285 --- /dev/null +++ b/users/default.nix @@ -0,0 +1,12 @@ +{inputs, ...}: { + configurations = { + home = { + builder = inputs.hm.lib.homeManagerConfiguration; + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + + users = { + seth = {}; + }; + }; + }; +} |
