forked from fediversity/fediversity
rename the caller option to the more apt caller (#547)
Reviewed-on: fediversity/fediversity#547
This commit is contained in:
parent
195bc476be
commit
9490612630
3 changed files with 13 additions and 15 deletions
|
|
@ -5,7 +5,6 @@
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
let
|
let
|
||||||
self = "deployment/check/data-model-ssh/data-model.nix";
|
|
||||||
inherit (sources) nixpkgs;
|
inherit (sources) nixpkgs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
@ -40,7 +39,7 @@ in
|
||||||
key-file = null;
|
key-file = null;
|
||||||
inherit sshOpts;
|
inherit sshOpts;
|
||||||
};
|
};
|
||||||
module = self;
|
caller = "deployment/check/data-model-ssh/data-model.nix";
|
||||||
inherit args deployment-name;
|
inherit args deployment-name;
|
||||||
root-path = pathToRoot;
|
root-path = pathToRoot;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
let
|
let
|
||||||
self = "deployment/check/data-model-tf/data-model.nix";
|
|
||||||
inherit (sources) nixpkgs;
|
inherit (sources) nixpkgs;
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
|
@ -40,7 +39,7 @@ in
|
||||||
key-file = null;
|
key-file = null;
|
||||||
inherit sshOpts;
|
inherit sshOpts;
|
||||||
};
|
};
|
||||||
module = self;
|
caller = "deployment/check/data-model-tf/data-model.nix";
|
||||||
inherit args deployment-name httpBackend;
|
inherit args deployment-name httpBackend;
|
||||||
root-path = pathToRoot;
|
root-path = pathToRoot;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ let
|
||||||
writeConfig =
|
writeConfig =
|
||||||
{
|
{
|
||||||
system,
|
system,
|
||||||
module,
|
caller,
|
||||||
root-path,
|
root-path,
|
||||||
deployment-type,
|
deployment-type,
|
||||||
deployment-name,
|
deployment-name,
|
||||||
args,
|
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.
|
# enough to call it again to extract different info elsewhere later.
|
||||||
# we use this to make a deployment script using the desired nixos config,
|
# 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
|
# which would otherwise not be serializable, while nix also makes it hard to
|
||||||
|
|
@ -46,7 +46,7 @@ let
|
||||||
pkgs.writers.writeText "configuration.nix" ''
|
pkgs.writers.writeText "configuration.nix" ''
|
||||||
import ${root-path}/deployment/nixos.nix {
|
import ${root-path}/deployment/nixos.nix {
|
||||||
system = "${system}";
|
system = "${system}";
|
||||||
configuration = (import "${root-path}/${module}" (builtins.fromJSON "${
|
configuration = (import "${root-path}/${caller}" (builtins.fromJSON "${
|
||||||
lib.replaceStrings [ "\"" ] [ "\\\"" ] (lib.strings.toJSON args)
|
lib.replaceStrings [ "\"" ] [ "\\\"" ] (lib.strings.toJSON args)
|
||||||
}")).${deployment-name}.${deployment-type}.nixos-configuration;
|
}")).${deployment-name}.${deployment-type}.nixos-configuration;
|
||||||
}
|
}
|
||||||
|
|
@ -121,8 +121,8 @@ let
|
||||||
};
|
};
|
||||||
inherit nixos-configuration;
|
inherit nixos-configuration;
|
||||||
ssh = host-ssh;
|
ssh = host-ssh;
|
||||||
module = mkOption {
|
caller = mkOption {
|
||||||
description = "The module to call to obtain the NixOS configuration from.";
|
description = "The calling module to obtain the NixOS configuration from.";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
args = mkOption {
|
args = mkOption {
|
||||||
|
|
@ -147,7 +147,7 @@ let
|
||||||
inherit (ssh-host.config)
|
inherit (ssh-host.config)
|
||||||
system
|
system
|
||||||
ssh
|
ssh
|
||||||
module
|
caller
|
||||||
args
|
args
|
||||||
deployment-name
|
deployment-name
|
||||||
root-path
|
root-path
|
||||||
|
|
@ -168,7 +168,7 @@ let
|
||||||
nixos_conf = writeConfig {
|
nixos_conf = writeConfig {
|
||||||
inherit
|
inherit
|
||||||
system
|
system
|
||||||
module
|
caller
|
||||||
args
|
args
|
||||||
deployment-name
|
deployment-name
|
||||||
root-path
|
root-path
|
||||||
|
|
@ -204,8 +204,8 @@ let
|
||||||
};
|
};
|
||||||
inherit nixos-configuration;
|
inherit nixos-configuration;
|
||||||
ssh = host-ssh;
|
ssh = host-ssh;
|
||||||
module = mkOption {
|
caller = mkOption {
|
||||||
description = "The module to call to obtain the NixOS configuration from.";
|
description = "The calling module to obtain the NixOS configuration from.";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
args = mkOption {
|
args = mkOption {
|
||||||
|
|
@ -233,7 +233,7 @@ let
|
||||||
inherit (tf-host.config)
|
inherit (tf-host.config)
|
||||||
system
|
system
|
||||||
ssh
|
ssh
|
||||||
module
|
caller
|
||||||
args
|
args
|
||||||
deployment-name
|
deployment-name
|
||||||
root-path
|
root-path
|
||||||
|
|
@ -255,7 +255,7 @@ let
|
||||||
nixos_conf = writeConfig {
|
nixos_conf = writeConfig {
|
||||||
inherit
|
inherit
|
||||||
system
|
system
|
||||||
module
|
caller
|
||||||
args
|
args
|
||||||
deployment-name
|
deployment-name
|
||||||
root-path
|
root-path
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue