summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ci.nix2
-rw-r--r--jeschli/krops.nix2
-rw-r--r--krebs/3modules/ci.nix8
-rw-r--r--krebs/krops.nix36
-rw-r--r--lass/krops.nix2
-rw-r--r--makefu/krops.nix12
-rw-r--r--tv/krops.nix2
7 files changed, 45 insertions, 19 deletions
diff --git a/ci.nix b/ci.nix
index 631c3dc41..a383a0631 100644
--- a/ci.nix
+++ b/ci.nix
@@ -16,6 +16,6 @@ let
ci-systems = filterAttrs (_: v: v.ci) system.config.krebs.hosts;
build = host: owner:
- ((import (toString ./. + "/${owner}/krops.nix") { name = host; }).test {target = "${getEnv "HOME"}/stockholm-build/${host}";});
+ ((import (toString ./. + "/${owner}/krops.nix") { name = host; }).test {target = "${getEnv "HOME"}/stockholm-tmp";});
in mapAttrs (n: h: build n h.owner.name) ci-systems
diff --git a/jeschli/krops.nix b/jeschli/krops.nix
index d45d57c63..fff014377 100644
--- a/jeschli/krops.nix
+++ b/jeschli/krops.nix
@@ -1,11 +1,13 @@
{ name }: let
inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-nixpkgs
krebs-source
lib
pkgs
;
source = { test }: lib.evalSource [
+ (krebs-nixpkgs { test = test; })
krebs-source
{
nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix";
diff --git a/krebs/3modules/ci.nix b/krebs/3modules/ci.nix
index d8d0e7f3d..a47dbe611 100644
--- a/krebs/3modules/ci.nix
+++ b/krebs/3modules/ci.nix
@@ -27,14 +27,14 @@ let
hostname = config.networking.hostName;
getJobs = pkgs.writeDash "get_jobs" ''
set -efu
- nix-build --no-out-link --quiet -Q ./ci.nix > /dev/null
- js="$(nix-instantiate --quiet -Q --eval --strict --json ./ci.nix)"
- echo "$js" | jq -r 'to_entries[] | [.key, .value] | @tsv' \
+ ${pkgs.nix}/bin/nix-build --no-out-link --quiet -Q ./ci.nix >&2
+ json="$(${pkgs.nix}/bin/nix-instantiate --quiet -Q --eval --strict --json ./ci.nix)"
+ echo "$json" | ${pkgs.jq}/bin/jq -r 'to_entries[] | [.key, .value] | @tsv' \
| while read -r host builder; do
gcroot=${shell.escape profileRoot}/$host-builder
${pkgs.nix}/bin/nix-env -p "$gcroot" --set "$builder"
done
- echo "$js"
+ echo "$json"
'';
profileRoot = "/nix/var/nix/profiles/ci";
diff --git a/krebs/krops.nix b/krebs/krops.nix
index 763e76b83..1058e73c0 100644
--- a/krebs/krops.nix
+++ b/krebs/krops.nix
@@ -7,11 +7,24 @@
# TODO document why pkgs should be used like this
pkgs = import "${krops}/pkgs" {};
- krebs-source = {
+ krebs-nixpkgs = { test ? false }: if test then {
+ nixpkgs.file = {
+ path = toString (pkgs.fetchFromGitHub {
+ owner = "nixos";
+ repo = "nixpkgs";
+ rev = (lib.importJSON ./nixpkgs.json).rev;
+ sha256 = (lib.importJSON ./nixpkgs.json).sha256;
+ });
+ useChecksum = true;
+ };
+ } else {
nixpkgs.git = {
ref = (lib.importJSON ./nixpkgs.json).rev;
url = https://github.com/NixOS/nixpkgs;
};
+ };
+
+ krebs-source = {
stockholm.file = toString ../.;
stockholm-version.pipe = toString (pkgs.writeDash "${name}-version" ''
set -efu
@@ -28,21 +41,18 @@
};
source ={ test }: lib.evalSource [
+ (krebs-nixpkgs { test = test; })
krebs-source
{
nixos-config.symlink = "stockholm/krebs/1systems/${name}/config.nix";
- secrets =
- if test
- then {
- file = toString <stockholm/krebs/0tests/data/secrets>;
- }
- else {
- pass = {
- dir = "${lib.getEnv "HOME"}/brain";
- name = "krebs-secrets/${name}";
- };
- }
- ;
+ secrets = if test then {
+ file = toString <stockholm/krebs/0tests/data/secrets>;
+ } else {
+ pass = {
+ dir = "${lib.getEnv "HOME"}/brain";
+ name = "krebs-secrets/${name}";
+ };
+ };
}
];
diff --git a/lass/krops.nix b/lass/krops.nix
index c2669c8f2..26668de65 100644
--- a/lass/krops.nix
+++ b/lass/krops.nix
@@ -1,5 +1,6 @@
{ name }: let
inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-nixpkgs
krebs-source
lib
pkgs
@@ -12,6 +13,7 @@
;
source = { test }: lib.evalSource [
+ (krebs-nixpkgs { test = test; })
krebs-source
{
nixos-config.symlink = "stockholm/lass/1systems/${name}/physical.nix";
diff --git a/makefu/krops.nix b/makefu/krops.nix
index 2b43d541d..6c510eba3 100644
--- a/makefu/krops.nix
+++ b/makefu/krops.nix
@@ -23,7 +23,17 @@
{
# nixos-18.09 @ 2018-09-18
# + uhub/sqlite: 5dd7610401747
- nixpkgs = if test || host-src.full then {
+ nixpkgs = if test then {
+ file = {
+ path = toString (pkgs.fetchFromGitHub {
+ owner = "makefu";
+ repo = "nixpkgs";
+ rev = nixpkgs-src.rev;
+ sha256 = nixpkgs-src.sha256;
+ });
+ useChecksum = true;
+ };
+ } else if host-src.full then {
git.ref = nixpkgs-src.rev;
git.url = nixpkgs-src.url;
} else if host-src.arm6 then {
diff --git a/tv/krops.nix b/tv/krops.nix
index e922630f7..3b60d3208 100644
--- a/tv/krops.nix
+++ b/tv/krops.nix
@@ -1,12 +1,14 @@
{ name }: rec {
inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-nixpkgs
krebs-source
lib
pkgs
;
source = lib.evalSource [
+ (krebs-nixpkgs { test = true; })
krebs-source
{
nixos-config.symlink = "stockholm/tv/1systems/${name}/config.nix";