fix(configuration-types)!: consolidate names with upstream

`nixDarwin{Machines,Modules}` -> `darwin{Machines,Modules}`
This commit is contained in:
reo101 2024-07-25 12:21:59 +03:00
parent bdeb0ae13b
commit 719b12e431
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
3 changed files with 17 additions and 14 deletions

View file

@ -7,6 +7,7 @@ let
hasFiles hasFiles
hasDirectories hasDirectories
recurseDir recurseDir
configuration-type-to-outputs-modules
configuration-type-to-outputs-machines; configuration-type-to-outputs-machines;
in in
let let
@ -16,8 +17,8 @@ let
useGlobalPkgs = true; useGlobalPkgs = true;
# Do not keep packages in ${HOME} # Do not keep packages in ${HOME}
useUserPackages = true; useUserPackages = true;
# Default import all of our exported homeManagerModules # Default import all of our exported `home-manager` modules
sharedModules = builtins.attrValues config.flake.homeManagerModules; sharedModules = builtins.attrValues config.flake.${configuration-type-to-outputs-modules "home-manager"};
# Pass in `inputs`, `outputs` and maybe `meta` # Pass in `inputs`, `outputs` and maybe `meta`
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs outputs; inherit inputs outputs;
@ -57,7 +58,7 @@ let
{ {
networking.hostName = lib.mkDefault hostname; networking.hostName = lib.mkDefault hostname;
} }
] ++ (builtins.attrValues config.flake.nixosModules); ] ++ (builtins.attrValues config.flake.${configuration-type-to-outputs-modules "nixos"});
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
@ -74,7 +75,7 @@ let
"${root}/configuration.nix" "${root}/configuration.nix"
# Home Manager # Home Manager
(homeManagerModule args) (homeManagerModule args)
] ++ (builtins.attrValues config.flake.nixOnDroidModules); ] ++ (builtins.attrValues config.flake.${configuration-type-to-outputs-modules "nix-on-droid"});
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs outputs; inherit inputs outputs;
@ -97,7 +98,7 @@ let
# { # {
# nixpkgs.hostPlatform = system; # nixpkgs.hostPlatform = system;
# } # }
] ++ (builtins.attrValues config.flake.nixDarwinModules); ] ++ (builtins.attrValues config.flake.${configuration-type-to-outputs-modules "nix-darwin"});
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
@ -110,7 +111,7 @@ let
modules = [ modules = [
"${root}/home.nix" "${root}/home.nix"
] ++ (builtins.attrValues config.flake.homeManagerModules); ] ++ (builtins.attrValues config.flake.${configuration-type-to-outputs-modules "home-manager"});
extraSpecialArgs = { extraSpecialArgs = {
inherit inputs outputs; inherit inputs outputs;
@ -208,9 +209,11 @@ in
]; ];
in { in {
# Machines # Machines
# NOTE: manually inheriting generated machines to avoid recursion
# (`autoMachines` depends on `config.flake` itself)
inherit (autoMachines) inherit (autoMachines)
nixosMachines nixosMachines
nixDarwinMachines darwinMachines
nixOnDroidMachines nixOnDroidMachines
homeManagerMachines; homeManagerMachines;
@ -236,7 +239,7 @@ in
(lib.strings.removeSuffix ".nix") (lib.strings.removeSuffix ".nix")
(builtins.attrNames (configurationFiles."home" or { }))); (builtins.attrNames (configurationFiles."home" or { })));
}) })
config.flake.nixosMachines; config.flake.${configuration-type-to-outputs-machines "nixos"};
nixOnDroidConfigurations = nixOnDroidConfigurations =
createConfigurations createConfigurations
@ -253,7 +256,7 @@ in
inherit system; inherit system;
hostname = host; hostname = host;
}) })
config.flake.nixOnDroidMachines; config.flake.${configuration-type-to-outputs-machines "nix-on-droid"};
darwinConfigurations = darwinConfigurations =
createConfigurations createConfigurations
@ -276,7 +279,7 @@ in
(lib.strings.removeSuffix ".nix") (lib.strings.removeSuffix ".nix")
(builtins.attrNames (configurationFiles."home" or { }))); (builtins.attrNames (configurationFiles."home" or { })));
}) })
config.flake.nixDarwinMachines; config.flake.${configuration-type-to-outputs-machines "nix-darwin"};
homeConfigurations = homeConfigurations =
createConfigurations createConfigurations
@ -293,7 +296,7 @@ in
inherit system; inherit system;
hostname = host; hostname = host;
}) })
config.flake.homeManagerMachines; config.flake.${configuration-type-to-outputs-machines "home-manager"};
}; };
}; };
} }

View file

@ -136,7 +136,7 @@ in
inherit (autoModules) inherit (autoModules)
nixosModules nixosModules
nixOnDroidModules nixOnDroidModules
nixDarwinModules darwinModules
homeManagerModules homeManagerModules
flakeModules; flakeModules;
}; };

View file

@ -62,7 +62,7 @@ rec {
{ {
nixos = "nixosMachines"; nixos = "nixosMachines";
nix-on-droid = "nixOnDroidMachines"; nix-on-droid = "nixOnDroidMachines";
nix-darwin = "nixDarwinMachines"; nix-darwin = "darwinMachines";
home-manager = "homeManagerMachines"; home-manager = "homeManagerMachines";
} }
(configuration-type: (configuration-type:
@ -74,7 +74,7 @@ rec {
{ {
nixos = "nixosModules"; nixos = "nixosModules";
nix-on-droid = "nixOnDroidModules"; nix-on-droid = "nixOnDroidModules";
nix-darwin = "nixDarwinModules"; nix-darwin = "darwinModules";
home-manager = "homeManagerModules"; home-manager = "homeManagerModules";
flake = "flakeModules"; flake = "flakeModules";
} }