2021-11-22 10:52:35 +01:00
|
|
|
let
|
|
|
|
tools = import ./tools.nix { insideVm = true; };
|
|
|
|
|
2021-11-22 22:18:28 +01:00
|
|
|
testPkg = let
|
|
|
|
text = builtins.trace "must appear during evaluation" ''
|
|
|
|
echo "must appear during build"
|
|
|
|
mkdir -p $out
|
|
|
|
'';
|
|
|
|
in tools.pkgs.runCommand "test-package" {} text;
|
2021-11-22 10:52:35 +01:00
|
|
|
in {
|
|
|
|
meta = {
|
|
|
|
nixpkgs = tools.pkgs;
|
|
|
|
};
|
|
|
|
|
2021-12-04 10:03:26 +01:00
|
|
|
defaults = {
|
|
|
|
environment.etc."deployment".text = "FIRST";
|
2021-11-22 10:52:35 +01:00
|
|
|
|
2021-11-22 22:18:28 +01:00
|
|
|
# Will be created during activation
|
|
|
|
users.users.testuser = {
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "testgroup";
|
|
|
|
};
|
|
|
|
users.groups.testgroup = {};
|
|
|
|
|
2021-12-05 10:14:12 +01:00
|
|
|
# /run/keys/custom-name
|
|
|
|
deployment.keys.original-name = {
|
|
|
|
name = "custom-name";
|
|
|
|
text = "@poison@";
|
|
|
|
};
|
|
|
|
|
2021-11-22 22:18:28 +01:00
|
|
|
# /run/keys/key-text
|
|
|
|
deployment.keys.key-text = {
|
2021-12-05 10:14:12 +01:00
|
|
|
text = "@poison@";
|
2021-11-22 22:18:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# /tmp/another-key-dir/key-command
|
|
|
|
deployment.keys.key-command = {
|
|
|
|
destDir = "/tmp/another-key-dir";
|
|
|
|
keyCommand = [ "hostname" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# /tmp/another-key-dir/key-file
|
|
|
|
deployment.keys.key-file = {
|
|
|
|
destDir = "/tmp/another-key-dir";
|
|
|
|
keyFile = "/tmp/bundle/key-file";
|
|
|
|
};
|
|
|
|
|
|
|
|
# /tmp/another-key-dir/key-file-2
|
|
|
|
deployment.keys.key-file-2 = {
|
|
|
|
destDir = "/tmp/another-key-dir";
|
|
|
|
keyFile = ./key-file;
|
|
|
|
};
|
|
|
|
|
|
|
|
# /run/keys/pre-activation
|
|
|
|
deployment.keys.pre-activation = {
|
|
|
|
text = "pre-activation key";
|
|
|
|
uploadAt = "pre-activation";
|
|
|
|
|
|
|
|
user = "testuser";
|
|
|
|
group = "testgroup";
|
|
|
|
permissions = "640";
|
|
|
|
};
|
|
|
|
|
|
|
|
# /run/keys/post-activation
|
|
|
|
deployment.keys.post-activation = {
|
|
|
|
text = "post-activation key";
|
|
|
|
uploadAt = "post-activation";
|
|
|
|
|
|
|
|
user = "testuser";
|
|
|
|
group = "testgroup";
|
|
|
|
permissions = "600";
|
|
|
|
};
|
2021-11-22 10:52:35 +01:00
|
|
|
};
|
|
|
|
|
2021-12-04 10:03:26 +01:00
|
|
|
alpha = { lib, ... }: {
|
|
|
|
imports = [
|
|
|
|
(tools.getStandaloneConfigFor "alpha")
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.systemPackages = [ testPkg ];
|
|
|
|
|
2022-01-28 03:48:25 +01:00
|
|
|
documentation.nixos.enable = lib.mkForce true;
|
|
|
|
|
2021-12-04 10:03:26 +01:00
|
|
|
system.activationScripts.colmena-test.text = ''
|
|
|
|
echo "must appear during activation"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-11-22 10:52:35 +01:00
|
|
|
deployer = tools.getStandaloneConfigFor "deployer";
|
|
|
|
beta = tools.getStandaloneConfigFor "beta";
|
|
|
|
gamma = tools.getStandaloneConfigFor "gamma";
|
2022-06-03 01:43:28 +02:00
|
|
|
|
|
|
|
"gamma.tld" = { lib, ... }: {
|
|
|
|
imports = [
|
|
|
|
(tools.getStandaloneConfigFor "gamma")
|
|
|
|
];
|
|
|
|
|
|
|
|
deployment.tags = lib.mkForce [];
|
|
|
|
};
|
2021-11-22 10:52:35 +01:00
|
|
|
}
|