mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
nix-remote-build: add module
This commit is contained in:
parent
ace8759715
commit
e81d71d53a
7 changed files with 290 additions and 0 deletions
|
|
@ -181,6 +181,7 @@ import nmtSrc {
|
|||
./modules/misc/manual
|
||||
./modules/misc/news
|
||||
./modules/misc/nix
|
||||
./modules/misc/nix-remote-build
|
||||
./modules/misc/specialisation
|
||||
./modules/misc/xdg
|
||||
./modules/xresources
|
||||
|
|
|
|||
4
tests/modules/misc/nix-remote-build/default.nix
Normal file
4
tests/modules/misc/nix-remote-build/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
nix-remote-build-empty = ./empty-settings.nix;
|
||||
nix-remote-build-example = ./example-settings.nix;
|
||||
}
|
||||
11
tests/modules/misc/nix-remote-build/empty-settings.nix
Normal file
11
tests/modules/misc/nix-remote-build/empty-settings.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
nix = {
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/nix
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ssh-ng://bob@foo.example.com aarch64-linux /path/to/ssh-key 2 4 benchmark,big-parallel,kvm,nixos-test,big-parallel big-parallel PUBLIC_HOST_KEY
|
||||
ssh://alice@192.168.1.42 aarch64-darwin,x86_64-darwin ~/.ssh/id_rsa 1 1 apple-virt,big-parallel,nixos-test - PUBLIC_HOST_KEY_2
|
||||
64
tests/modules/misc/nix-remote-build/example-settings.nix
Normal file
64
tests/modules/misc/nix-remote-build/example-settings.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
nix = {
|
||||
package = config.lib.test.mkStubPackage {
|
||||
version = lib.getVersion pkgs.nixVersions.stable;
|
||||
};
|
||||
|
||||
distributedBuilds = true;
|
||||
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "foo.example.com";
|
||||
sshUser = "bob";
|
||||
sshKey = "/path/to/ssh-key";
|
||||
publicHostKey = "PUBLIC_HOST_KEY";
|
||||
systems = [ "aarch64-linux" ];
|
||||
speedFactor = 4;
|
||||
protocol = "ssh-ng";
|
||||
maxJobs = 2;
|
||||
supportedFeatures = [
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
mandatoryFeatures = [
|
||||
"big-parallel"
|
||||
];
|
||||
}
|
||||
{
|
||||
hostName = "192.168.1.42";
|
||||
sshUser = "alice";
|
||||
sshKey = "~/.ssh/id_rsa";
|
||||
publicHostKey = "PUBLIC_HOST_KEY_2";
|
||||
systems = [
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
supportedFeatures = [
|
||||
"apple-virt"
|
||||
"big-parallel"
|
||||
"nixos-test"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists "home-files/.config/nix/machines"
|
||||
|
||||
assertFileContent \
|
||||
home-files/.config/nix/machines \
|
||||
${./example-settings-expected}
|
||||
|
||||
assertFileContains home-files/.config/nix/nix.conf \
|
||||
'builders = @${config.xdg.configHome}/nix/machines'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue