rename module to caller

Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
This commit is contained in:
Kiara Grouwstra 2025-10-22 13:51:09 +02:00
parent ce9565eb70
commit de46557fe1
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
3 changed files with 17 additions and 20 deletions

View file

@ -5,7 +5,6 @@
...
}@args:
let
self = "deployment/check/data-model-ssh/data-model.nix";
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
@ -40,7 +39,7 @@ in
key-file = null;
inherit sshOpts;
};
module = self;
caller = "deployment/check/data-model-ssh/data-model.nix";
inherit args deployment-name;
root-path = pathToRoot;
};

View file

@ -5,7 +5,6 @@
...
}@args:
let
self = "deployment/check/data-model-tf/data-model.nix";
inherit (sources) nixpkgs;
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
@ -40,7 +39,7 @@ in
key-file = null;
inherit sshOpts;
};
module = self;
caller = "deployment/check/data-model-tf/data-model.nix";
inherit args deployment-name httpBackend;
root-path = pathToRoot;
};

View file

@ -31,13 +31,13 @@ let
writeConfig =
{
system,
module,
caller,
root-path,
deployment-type,
deployment-name,
args,
}:
# having a `module` location and (serializable) `args`, we know
# having a `caller` location and (serializable) `args`, we know
# enough to call it again to extract different info elsewhere later.
# we use this to make a deployment script using the desired nixos config,
# which would otherwise not be serializable, while nix also makes it hard to
@ -47,7 +47,7 @@ let
pkgs.writers.writeText "configuration.nix" ''
import ${root-path}/deployment/nixos.nix {
system = "${system}";
configuration = (import "${root-path}/${module}" (builtins.fromJSON "${
configuration = (import "${root-path}/${caller}" (builtins.fromJSON "${
lib.replaceStrings [ "\"" ] [ "\\\"" ] (lib.strings.toJSON args)
}")).${deployment-name}.${deployment-type}.nixos-configuration;
}
@ -122,8 +122,8 @@ let
};
inherit nixos-configuration;
ssh = host-ssh;
module = mkOption {
description = "The module to call to obtain the NixOS configuration from.";
caller = mkOption {
description = "The calling module to obtain the NixOS configuration from.";
type = types.str;
};
args = mkOption {
@ -148,7 +148,7 @@ let
inherit (ssh-host.config)
system
ssh
module
caller
args
deployment-name
root-path
@ -169,7 +169,7 @@ let
nixos_conf = writeConfig {
inherit
system
module
caller
args
deployment-name
root-path
@ -205,8 +205,8 @@ let
};
inherit nixos-configuration;
ssh = host-ssh;
module = mkOption {
description = "The module to call to obtain the NixOS configuration from.";
caller = mkOption {
description = "The calling module to obtain the NixOS configuration from.";
type = types.str;
};
args = mkOption {
@ -234,7 +234,7 @@ let
inherit (tf-host.config)
system
ssh
module
caller
args
deployment-name
root-path
@ -256,7 +256,7 @@ let
nixos_conf = writeConfig {
inherit
system
module
caller
args
deployment-name
root-path
@ -422,9 +422,8 @@ let
};
inherit nixos-configuration;
ssh = host-ssh;
# TODO: add proxmox info
module = mkOption {
description = "The module to call to obtain the NixOS configuration from.";
caller = mkOption {
description = "The calling module to obtain the NixOS configuration from.";
type = types.str;
};
args = mkOption {
@ -506,7 +505,7 @@ let
inherit (tf-host.config)
system
ssh
module
caller
args
deployment-name
httpBackend
@ -533,7 +532,7 @@ let
nixos_conf = writeConfig {
inherit
system
module
caller
args
deployment-name
root-path