flake: dedup specialArgs
This commit is contained in:
parent
4e45343f88
commit
250931a8fd
1 changed files with 12 additions and 20 deletions
32
flake.nix
32
flake.nix
|
@ -73,6 +73,15 @@
|
|||
(hostname: { system, ... }: system == x86_64-darwin)
|
||||
hosts;
|
||||
|
||||
baseSpecialArgs = {
|
||||
inherit inputs;
|
||||
globalData = import ./data.nix;
|
||||
usersPath = ./users;
|
||||
hostsPath = ./hosts;
|
||||
packagesPath = ./packages;
|
||||
sharedPath = ./shared;
|
||||
};
|
||||
|
||||
mkDeploymentModule = { targetHost, system, ... }: ({ lib, ... }: {
|
||||
options.deployment = with lib; {
|
||||
system = mkOption {
|
||||
|
@ -93,10 +102,7 @@
|
|||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {
|
||||
packagesPath = ./packages;
|
||||
hostsPath = ./hosts;
|
||||
};
|
||||
home-manager.extraSpecialArgs = baseSpecialArgs;
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
imports = [
|
||||
|
@ -197,14 +203,7 @@
|
|||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
globalData = import ./data.nix;
|
||||
usersPath = ./users;
|
||||
hostsPath = ./hosts;
|
||||
packagesPath = ./packages;
|
||||
sharedPath = ./shared;
|
||||
} // specialArgs;
|
||||
specialArgs = baseSpecialArgs // specialArgs;
|
||||
|
||||
modules =
|
||||
(with inputs; [
|
||||
|
@ -231,14 +230,7 @@
|
|||
, targetHost ? null
|
||||
}:
|
||||
inputs.nix-darwin.lib.darwinSystem {
|
||||
inputs = {
|
||||
inherit inputs;
|
||||
globalData = import ./data.nix;
|
||||
usersPath = ./users;
|
||||
hostsPath = ./hosts;
|
||||
packagesPath = ./packages;
|
||||
sharedPath = ./shared;
|
||||
} // specialArgs;
|
||||
specialArgs = baseSpecialArgs // specialArgs;
|
||||
|
||||
modules =
|
||||
(with inputs; [
|
||||
|
|
Loading…
Add table
Reference in a new issue