Created
July 6, 2017 14:28
-
-
Save gilligan/bed28a6dca9ed6a2758553799f0ea67c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
network.description = "hc-web continuous integration server"; | |
jenkinsMaster = | |
{ config, pkgs, ... }: | |
{ | |
# server config ... | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ... }: { | |
name = "boot"; | |
machine = (import server.nix).jenkinsMaster; | |
testScript = '' | |
$machine->start; | |
# ... lotsa tests ... | |
''; | |
} |
To be honest, I don’t know how nixops evaluates the module configs you hand it, e.g. in the example from the manual:
$ nixops create ./trivial.nix ./trivial-vbox.nix -d trivial
There are two attribute sets of modules given, only one of them contains nixops-specific options (stuff from https://nixos.org/nixops/manual/#ch-options). I’d think nixops might do something like merge every attribute with the same name in all files you give it on the command line, as follows:
listOfAttributeModules:
import <nixpkgs/nixos> {
configuration = {
imports = [ nixopsOptionDeclarations ] ++ listOfAttributeModules;
};
}
The part where all nixops-specific options are imported is important.
That’s just my guess, to be sure you’d have to look at the nixops source.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So test requires some more memory otherwise jenkins explodes.
I cannot add
virtualisation.memorySize
to theserver.nix
because nixops will choke on that since it's only valid for the tests..How can I add the virtualisation attribute in
test.nix
? The only thing I could think of now is to move the attribute set that the jenkinsMaster function returns to a separate .nix file and then just do something like ...Actually just thought of that while typing this up. Is this what you would do? I am thinking there is a different way ...