summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-11 11:26:24 +0200
committerlassulus <lassulus@lassul.us>2017-07-12 19:09:36 +0200
commit3363a8746c9152709abcd5adbbcdc00c2df0ff39 (patch)
treea10665f6ddf735eb1ac3970f2cdb24f4cf6e4ed7 /shared
parent9215b5b6880c833721caa7572b7480c7912d7fd6 (diff)
move source config from module system to 1systems/*/source.nix
Diffstat (limited to 'shared')
-rw-r--r--shared/1systems/test-all-krebs-modules/config.nix (renamed from shared/1systems/test-all-krebs-modules.nix)2
-rw-r--r--shared/1systems/test-all-krebs-modules/source.nix3
-rw-r--r--shared/1systems/test-arch/config.nix (renamed from shared/1systems/test-arch.nix)2
-rw-r--r--shared/1systems/test-arch/source.nix3
-rw-r--r--shared/1systems/test-centos6/config.nix (renamed from shared/1systems/test-centos6.nix)4
-rw-r--r--shared/1systems/test-centos6/source.nix3
-rw-r--r--shared/1systems/test-centos7.nix16
-rw-r--r--shared/1systems/test-centos7/config.nix16
-rw-r--r--shared/1systems/test-centos7/source.nix3
-rw-r--r--shared/1systems/test-failing/config.nix (renamed from shared/1systems/test-failing.nix)2
-rw-r--r--shared/1systems/test-failing/source.nix3
-rw-r--r--shared/1systems/test-minimal-deploy/config.nix (renamed from shared/1systems/test-minimal-deploy.nix)2
-rw-r--r--shared/1systems/test-minimal-deploy/source.nix3
-rw-r--r--shared/1systems/wolf/config.nix (renamed from shared/1systems/wolf.nix)35
-rw-r--r--shared/1systems/wolf/source.nix3
-rw-r--r--shared/2configs/default.nix12
-rw-r--r--shared/source.nix19
17 files changed, 80 insertions, 51 deletions
diff --git a/shared/1systems/test-all-krebs-modules.nix b/shared/1systems/test-all-krebs-modules/config.nix
index 39d7c494..7ebcf3b5 100644
--- a/shared/1systems/test-all-krebs-modules.nix
+++ b/shared/1systems/test-all-krebs-modules/config.nix
@@ -3,7 +3,7 @@ let
en = { enable = true;};
in {
imports = [
- ../.
+ <stockholm/shared>
];
krebs = {
enable = true;
diff --git a/shared/1systems/test-all-krebs-modules/source.nix b/shared/1systems/test-all-krebs-modules/source.nix
new file mode 100644
index 00000000..58d72365
--- /dev/null
+++ b/shared/1systems/test-all-krebs-modules/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-all-krebs-modules";
+}
diff --git a/shared/1systems/test-arch.nix b/shared/1systems/test-arch/config.nix
index a13fea42..453483d4 100644
--- a/shared/1systems/test-arch.nix
+++ b/shared/1systems/test-arch/config.nix
@@ -2,7 +2,7 @@
{
imports = [
- ../.
+ <stockholm/shared>
{
boot.loader.grub = {
device = "/dev/sda";
diff --git a/shared/1systems/test-arch/source.nix b/shared/1systems/test-arch/source.nix
new file mode 100644
index 00000000..ca230568
--- /dev/null
+++ b/shared/1systems/test-arch/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-arch";
+}
diff --git a/shared/1systems/test-centos6.nix b/shared/1systems/test-centos6/config.nix
index ebcece38..a81ff7c5 100644
--- a/shared/1systems/test-centos6.nix
+++ b/shared/1systems/test-centos6/config.nix
@@ -7,8 +7,8 @@ let
gw = "168.235.148.1";
in {
imports = [
- ../.
- ../2configs/os-templates/CAC-CentOS-6.5-64bit.nix
+ <stockholm/shared>
+ <stockholm/shared/2configs/os-templates/CAC-CentOS-6.5-64bit.nix>
{
networking.interfaces.enp11s0.ip4 = [
{
diff --git a/shared/1systems/test-centos6/source.nix b/shared/1systems/test-centos6/source.nix
new file mode 100644
index 00000000..0c7c78ec
--- /dev/null
+++ b/shared/1systems/test-centos6/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-centos6";
+}
diff --git a/shared/1systems/test-centos7.nix b/shared/1systems/test-centos7.nix
deleted file mode 100644
index 9ea063c9..00000000
--- a/shared/1systems/test-centos7.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-let
- inherit (lib) head;
-
-in {
- imports = [
- ../.
- ../2configs/os-templates/CAC-CentOS-7-64bit.nix
- ../2configs/temp/networking.nix
- ../2configs/temp/dirs.nix
- ];
-
- sound.enable = false;
- krebs.build.host = config.krebs.hosts.test-centos7;
-}
diff --git a/shared/1systems/test-centos7/config.nix b/shared/1systems/test-centos7/config.nix
new file mode 100644
index 00000000..58f99e87
--- /dev/null
+++ b/shared/1systems/test-centos7/config.nix
@@ -0,0 +1,16 @@
+{ config, lib, pkgs, ... }:
+
+let
+ inherit (lib) head;
+
+in {
+ imports = [
+ <stockholm/shared>
+ <stockholm/shared/2configs/os-templates/CAC-CentOS-7-64bit.nix>
+ <stockholm/shared/2configs/temp/networking.nix>
+ <stockholm/shared/2configs/temp/dirs.nix>
+ ];
+
+ sound.enable = false;
+ krebs.build.host = config.krebs.hosts.test-centos7;
+}
diff --git a/shared/1systems/test-centos7/source.nix b/shared/1systems/test-centos7/source.nix
new file mode 100644
index 00000000..5144477f
--- /dev/null
+++ b/shared/1systems/test-centos7/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-centos7";
+}
diff --git a/shared/1systems/test-failing.nix b/shared/1systems/test-failing/config.nix
index fe1c2cb6..fb6a5839 100644
--- a/shared/1systems/test-failing.nix
+++ b/shared/1systems/test-failing/config.nix
@@ -2,7 +2,7 @@
{
imports = [
- ../.
+ <stockholm/shared>
];
programs.ssh.startAgent = true;
programs.ssh.startAgent = false;
diff --git a/shared/1systems/test-failing/source.nix b/shared/1systems/test-failing/source.nix
new file mode 100644
index 00000000..3e17d0b5
--- /dev/null
+++ b/shared/1systems/test-failing/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-failing";
+}
diff --git a/shared/1systems/test-minimal-deploy.nix b/shared/1systems/test-minimal-deploy/config.nix
index bec2b38d..eab70367 100644
--- a/shared/1systems/test-minimal-deploy.nix
+++ b/shared/1systems/test-minimal-deploy/config.nix
@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
{
imports = [
- ../.
+ <stockholm/shared>
];
krebs = {
enable = true;
diff --git a/shared/1systems/test-minimal-deploy/source.nix b/shared/1systems/test-minimal-deploy/source.nix
new file mode 100644
index 00000000..2368cdd4
--- /dev/null
+++ b/shared/1systems/test-minimal-deploy/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "test-minimal-deploy";
+}
diff --git a/shared/1systems/wolf.nix b/shared/1systems/wolf/config.nix
index 584ee037..636f8e82 100644
--- a/shared/1systems/wolf.nix
+++ b/shared/1systems/wolf/config.nix
@@ -4,24 +4,24 @@ let
in
{
imports = [
- ../.
+ <stockholm/shared>
<nixpkgs/nixos/modules/profiles/qemu-guest.nix>
- ../2configs/collectd-base.nix
- ../2configs/central-stats-client.nix
- ../2configs/save-diskspace.nix
-
- ../2configs/cgit-mirror.nix
- ../2configs/graphite.nix
- ../2configs/repo-sync.nix
- ../2configs/shared-buildbot.nix
-
- ../2configs/shack/worlddomination.nix
- ../2configs/shack/drivedroid.nix
- # ../2configs/shack/nix-cacher.nix
- ../2configs/shack/mqtt_sub.nix
- ../2configs/shack/muell_caller.nix
- ../2configs/shack/radioactive.nix
- ../2configs/shack/share.nix
+ <stockholm/shared/2configs/collectd-base.nix>
+ <stockholm/shared/2configs/central-stats-client.nix>
+ <stockholm/shared/2configs/save-diskspace.nix>
+
+ <stockholm/shared/2configs/cgit-mirror.nix>
+ <stockholm/shared/2configs/graphite.nix>
+ <stockholm/shared/2configs/repo-sync.nix>
+ <stockholm/shared/2configs/shared-buildbot.nix>
+
+ <stockholm/shared/2configs/shack/worlddomination.nix>
+ <stockholm/shared/2configs/shack/drivedroid.nix>
+ # <stockholm/shared/2configs/shack/nix-cacher.nix>
+ <stockholm/shared/2configs/shack/mqtt_sub.nix>
+ <stockholm/shared/2configs/shack/muell_caller.nix>
+ <stockholm/shared/2configs/shack/radioactive.nix>
+ <stockholm/shared/2configs/shack/share.nix>
];
# use your own binary cache, fallback use cache.nixos.org (which is used by
@@ -43,6 +43,7 @@ in
};
nix = {
+ # use the up to date prism cache
binaryCaches = [
"http://cache.prism.r"
"https://cache.nixos.org/"
diff --git a/shared/1systems/wolf/source.nix b/shared/1systems/wolf/source.nix
new file mode 100644
index 00000000..d2bc4952
--- /dev/null
+++ b/shared/1systems/wolf/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/shared/source.nix> {
+ name = "wolf";
+}
diff --git a/shared/2configs/default.nix b/shared/2configs/default.nix
index 398f125e..2146f42e 100644
--- a/shared/2configs/default.nix
+++ b/shared/2configs/default.nix
@@ -7,18 +7,6 @@ with import <stockholm/lib>;
# TODO rename shared user to "krebs"
krebs.build.user = mkDefault config.krebs.users.shared;
- krebs.build.source = let inherit (config.krebs.build) host user; in {
- nixos-config.symlink = "stockholm/${user.name}/1systems/${host.name}.nix";
- nixpkgs.git = {
- url = https://github.com/NixOS/nixpkgs;
- ref = "72c9ed78d0b1d9d5f531805ddf5bf06bfd447614"; # nixos-17.03 @ 2017-06-17
- };
- secrets.file =
- if getEnv "dummy_secrets" == "true"
- then toString <stockholm/shared/6tests/data/secrets>
- else "${getEnv "HOME"}/secrets/krebs/${host.name}";
- stockholm.file = getEnv "PWD";
- };
networking.hostName = config.krebs.build.host.name;
diff --git a/shared/source.nix b/shared/source.nix
new file mode 100644
index 00000000..8ec9fbb6
--- /dev/null
+++ b/shared/source.nix
@@ -0,0 +1,19 @@
+with import <stockholm/lib>;
+host@{ name, secure ? false }: let
+ builder = if getEnv "dummy_secrets" == "true"
+ then "buildbot"
+ else "shared";
+ _file = <stockholm> + "/shared/1systems/${name}/source.nix";
+in
+ evalSource (toString _file) {
+ nixos-config.symlink = "stockholm/shared/1systems/${name}/config.nix";
+ secrets.file = getAttr builder {
+ buildbot = toString <stockholm/shared/6tests/data/secrets>;
+ lass = "${getEnv "HOME"}/secrets/krebs/${host.name}";
+ };
+ stockholm.file = toString <stockholm>;
+ nixpkgs.git = {
+ url = https://github.com/NixOS/nixpkgs;
+ ref = "72c9ed78d0b1d9d5f531805ddf5bf06bfd447614"; # nixos-17.03 @ 2017-06-17
+ };
+ }