Skip to content

Instantly share code, notes, and snippets.

@gilligan
Created July 6, 2017 14:28
Show Gist options
  • Save gilligan/bed28a6dca9ed6a2758553799f0ea67c to your computer and use it in GitHub Desktop.
Save gilligan/bed28a6dca9ed6a2758553799f0ea67c to your computer and use it in GitHub Desktop.
{
network.description = "hc-web continuous integration server";
jenkinsMaster =
{ config, pkgs, ... }:
{
# server config ...
};
}
import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ... }: {
name = "boot";
machine = (import server.nix).jenkinsMaster;
testScript = ''
$machine->start;
# ... lotsa tests ...
'';
}
@Profpatsch
Copy link

Profpatsch commented Jul 6, 2017

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