diff options
-rw-r--r-- | default.nix | 47 | ||||
-rw-r--r-- | host.nix | 7 | ||||
-rw-r--r-- | release.nix | 3 | ||||
-rw-r--r-- | spec.json | 17 |
4 files changed, 74 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a6feeb4 --- /dev/null +++ b/default.nix @@ -0,0 +1,47 @@ +{ nixpkgs, declInput }: let pkgs = import nixpkgs {}; in { + # this file generates the spec.json file which contains all the jobs + # a job set may be all the hosts of a user of stockholm + + # what we need to get here is for each host we want to build the "input" + # from its source.nix and add them to the "inputs" field + # in addition to that we need to define how a system is built inside the + # "local" release.nix + + # nixexprinput points to the path expression which should be used for evaluation + # nixexprpath is the file which will be built. + # that means in best case we should be able to use default.nix from + # <stockholm> after nixos-config is set! + + jobsets = pkgs.runCommand "spec.json" {} '' + cat <<EOF + ${builtins.toXML declInput} + EOF + cat > $out <<EOF + { + "makefu/x.r": { + "enabled": 1, + "hidden": false, + "description": "js", + "nixexprinput": "src", + "nixexprpath": "host.nix", + "checkinterval": 15, + "schedulingshares": 100, + "enableemail": false, + "emailoverride": "", + "keepnr": 3, + "inputs": { + "src": { "type": "git", "value": "http://cgit.euer.krebsco.de/hydra-stockholm", "emailresponsible": false }, + "stockholm": { "type": "git", "value": "http://cgit.krebsco.de/stockholm", "emailresponsible": false }, + "nixpkgs": { "type": "git", "value": "https://github.com/makefu/nixpkgs 51810e0", "emailresponsible": false }, + "nixos-hardware": { "type": "git", "value": "https://github.com/nixos/nixos-hardware.git 8a05dc9", "emailresponsible": false }, + "python": { "type": "git", "value": "https://github.com/garbas/nixpkgs-python cac319b", "emailresponsible": false }, + "nixos-config": { "type": "path", "value": "<stockholm/makefu/1systems/x/config.nix>", "emailresponsible": false }, + "secrets": { "type": "path", "value": "<stockholm/makefu/6tests/data/secrets>", "emailresponsible": false }, + "host" { "type": "string", "value": "x", "emailresponsible": false }, + "owner" { "type": "string", "value": "makefu", "emailresponsible": false } + } + } + } + EOF + ''; +} diff --git a/host.nix b/host.nix new file mode 100644 index 0000000..cbfbd66 --- /dev/null +++ b/host.nix @@ -0,0 +1,7 @@ +# copy-paste from stockholm/default.nix +import <nixpkgs/nixos/lib/eval-config.nix> { + modules = [ + (import <nixpkgs/nixos/lib/from-env.nix> "NIXOS_CONFIG" <nixos-config>) + ]; +} + diff --git a/release.nix b/release.nix new file mode 100644 index 0000000..0a12bc0 --- /dev/null +++ b/release.nix @@ -0,0 +1,3 @@ +{ nixpkgs }: let pkgs = import nixpkgs {}; in { + inherit (pkgs) hello; +} diff --git a/spec.json b/spec.json new file mode 100644 index 0000000..069a598 --- /dev/null +++ b/spec.json @@ -0,0 +1,17 @@ +{ + "enabled": 1, + "hidden": false, + "description": "generate Jobsets", + "nixexprinput": "src", + "nixexprpath": "default.nix", + "checkinterval": 300, + "schedulingshares": 100, + "enableemail": false, + "emailoverride": "", + "keepnr": 3, + "inputs": { + "src": { "type": "git", "value": "http://cgit.euer.krebsco.de/hydra-stockholm", "emailresponsible": false }, + "stockholm": { "type": "git", "value": "http://cgit.krebsco.de/stockholm", "emailresponsible": false }, + "nixpkgs": { "type": "git", "value": "git://github.com/nixos/nixpkgs.git release-17.09", "emailresponsible": false } + } +} |