flake: dedup specialArgs

This commit is contained in:
Dmitriy Pleshevskiy 2025-03-06 17:12:06 +03:00
parent 4e45343f88
commit 250931a8fd
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -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; [