summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
committerlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
commitf5328676c347a2785d2084628ba40448ec2680e8 (patch)
tree06046d7a2eed347cdd97a6bc81d6299500a3137f
parented9aca322dbcd2fa0484edb22076a56f49781d75 (diff)
parentb4d3d6c7ab2ff197b6dc47f366f698fceeb88242 (diff)
Merge branch 'staging/source'
-rw-r--r--Makefile2
-rw-r--r--lib/default.nix3
-rw-r--r--lib/eval-source.nix15
-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
-rw-r--r--shell.nix13
-rw-r--r--tv/1systems/alnus/config.nix (renamed from tv/1systems/alnus.nix)9
-rw-r--r--tv/1systems/alnus/source.nix4
-rw-r--r--tv/1systems/caxi/config.nix (renamed from tv/1systems/caxi.nix)8
-rw-r--r--tv/1systems/caxi/source.nix3
-rw-r--r--tv/1systems/cd/config.nix (renamed from tv/1systems/cd.nix)10
-rw-r--r--tv/1systems/cd/source.nix3
-rw-r--r--tv/1systems/mu/config.nix (renamed from tv/1systems/mu.nix)10
-rw-r--r--tv/1systems/mu/source.nix3
-rw-r--r--tv/1systems/nomic/config.nix (renamed from tv/1systems/nomic.nix)20
-rw-r--r--tv/1systems/nomic/source.nix4
-rw-r--r--tv/1systems/test/source.nix3
-rw-r--r--tv/1systems/wu/config.nix (renamed from tv/1systems/wu.nix)22
-rw-r--r--tv/1systems/wu/source.nix4
-rw-r--r--tv/1systems/xu/config.nix (renamed from tv/1systems/xu.nix)24
-rw-r--r--tv/1systems/xu/source.nix4
-rw-r--r--tv/1systems/zu/config.nix (renamed from tv/1systems/zu.nix)20
-rw-r--r--tv/1systems/zu/source.nix4
-rw-r--r--tv/2configs/default.nix18
-rw-r--r--tv/2configs/hw/x220.nix2
-rw-r--r--tv/source.nix27
41 files changed, 229 insertions, 137 deletions
diff --git a/Makefile b/Makefile
index cab53d5..e35aa89 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ export STOCKHOLM_VERSION ?= $(shell \
system ?= $(HOSTNAME)
$(if $(system),,$(error unbound variable: system))
-nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system).nix
+nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system)/config.nix
ifneq ($(words $(wildcard $(nixos-config))),1)
$(error bad nixos-config: $(nixos-config))
endif
diff --git a/lib/default.nix b/lib/default.nix
index 803a614..4c54f60 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,6 +1,9 @@
let
nixpkgs-lib = import <nixpkgs/lib>;
lib = with lib; nixpkgs-lib // builtins // {
+
+ evalSource = import ./eval-source.nix;
+
git = import ./git.nix { inherit lib; };
shell = import ./shell.nix { inherit lib; };
types = nixpkgs-lib.types // import ./types.nix { inherit lib; };
diff --git a/lib/eval-source.nix b/lib/eval-source.nix
new file mode 100644
index 0000000..468fc92
--- /dev/null
+++ b/lib/eval-source.nix
@@ -0,0 +1,15 @@
+with import <stockholm/lib>;
+let
+ eval = _file: source: evalModules {
+ modules = singleton {
+ inherit _file;
+ imports = map (source: { inherit source; }) (toList source);
+ options.source = mkOption {
+ type = types.attrsOf types.source;
+ default = {};
+ };
+ };
+ };
+in
+ # This function's return value can be used as pkgs.populate input.
+ _file: source: (eval _file source).config.source
diff --git a/shared/1systems/test-all-krebs-modules.nix b/shared/1systems/test-all-krebs-modules/config.nix
index 39d7c49..7ebcf3b 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 0000000..58d7236
--- /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 a13fea4..453483d 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 0000000..ca23056
--- /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 ebcece3..a81ff7c 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 0000000..0c7c78e
--- /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 9ea063c..0000000
--- 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 0000000..58f99e8
--- /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 0000000..5144477
--- /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 fe1c2cb..fb6a583 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 0000000..3e17d0b
--- /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 bec2b38..eab7036 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 0000000..2368cdd
--- /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 584ee03..636f8e8 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 0000000..d2bc495
--- /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 398f125..2146f42 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 0000000..8ec9fbb
--- /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
+ };
+ }
diff --git a/shell.nix b/shell.nix
index 3e7ba81..57957f8 100644
--- a/shell.nix
+++ b/shell.nix
@@ -43,9 +43,11 @@ let
'';
init.env = pkgs.writeText "init.env" /* sh */ ''
- config=''${config-$LOGNAME/1systems/$system.nix}
+ config=''${config-$LOGNAME/1systems/$system/config.nix}
+ source=''${source-$LOGNAME/1systems/$system/source.nix}
export config
+ export source
export system
export target
@@ -85,18 +87,19 @@ let
};
populate = pkgs.writeDash "init.env.populate" ''
set -efu
- ${pkgs.nix}/bin/nix-instantiate \
+ _source=$(${pkgs.nix}/bin/nix-instantiate \
--eval \
--json \
--readonly-mode \
--show-trace \
--strict \
-I nixos-config="$config" \
- -E 'with import <stockholm>; config.krebs.build.source' \
- |
+ "$source")
+ echo $_source |
${pkgs.populate}/bin/populate \
"$target_user@$target_host:$target_port$target_path" \
>&2
+ unset _source
'';
proxy = pkgs.writeDash "init.env.proxy" ''
set -efu
@@ -109,7 +112,7 @@ let
NIX_PATH=$(q "$target_path") \
STOCKHOLM_VERSION=$STOCKHOLM_VERSION \
nix-shell \
- --command $(q \
+ --run $(q \
config=$config \
system=$system \
target=$target \
diff --git a/tv/1systems/alnus.nix b/tv/1systems/alnus/config.nix
index ef2a050..dd9e594 100644
--- a/tv/1systems/alnus.nix
+++ b/tv/1systems/alnus/config.nix
@@ -4,10 +4,10 @@ with import <stockholm/lib>;
{
imports = [
- ../.
- ../2configs/hw/x220.nix
- ../2configs/exim-retiolum.nix
- ../2configs/retiolum.nix
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/x220.nix>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/retiolum.nix>
];
# TODO remove non-hardware stuff from ../2configs/hw/x220.nix
@@ -58,7 +58,6 @@ with import <stockholm/lib>;
krebs.build = {
host = config.krebs.hosts.alnus;
user = mkForce config.krebs.users.dv;
- source.nixpkgs.git.ref = mkForce "9b948ea439ddbaa26740ce35543e7e35d2aa6d18";
};
networking.networkmanager.enable = true;
diff --git a/tv/1systems/alnus/source.nix b/tv/1systems/alnus/source.nix
new file mode 100644
index 0000000..c3ed4dc
--- /dev/null
+++ b/tv/1systems/alnus/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/tv/source.nix> {
+ name = "alnus";
+ override.nixpkgs.git.ref = "9b948ea439ddbaa26740ce35543e7e35d2aa6d18";
+}
diff --git a/tv/1systems/caxi.nix b/tv/1systems/caxi/config.nix
index 59f3cd6..b136d1a 100644
--- a/tv/1systems/caxi.nix
+++ b/tv/1systems/caxi/config.nix
@@ -6,10 +6,10 @@ with import <stockholm/lib>;
krebs.build.host = config.krebs.hosts.caxi;
imports = [
- ../.
- ../2configs/hw/CAC-Developer-1.nix
- ../2configs/fs/CAC-CentOS-7-64bit.nix
- ../2configs/retiolum.nix
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/CAC-Developer-1.nix>
+ <stockholm/tv/2configs/fs/CAC-CentOS-7-64bit.nix>
+ <stockholm/tv/2configs/retiolum.nix>
];
networking = let
diff --git a/tv/1systems/caxi/source.nix b/tv/1systems/caxi/source.nix
new file mode 100644
index 0000000..bc875b7
--- /dev/null
+++ b/tv/1systems/caxi/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/tv/source.nix> {
+ name = "caxi";
+}
diff --git a/tv/1systems/cd.nix b/tv/1systems/cd/config.nix
index 9f2cec5..f78bcaf 100644
--- a/tv/1systems/cd.nix
+++ b/tv/1systems/cd/config.nix
@@ -6,11 +6,11 @@ with import <stockholm/lib>;
krebs.build.host = config.krebs.hosts.cd;
imports = [
- ../.
- ../2configs/hw/CAC-Developer-2.nix
- ../2configs/fs/CAC-CentOS-7-64bit.nix
- ../2configs/exim-smarthost.nix
- ../2configs/retiolum.nix
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/CAC-Developer-2.nix>
+ <stockholm/tv/2configs/fs/CAC-CentOS-7-64bit.nix>
+ <stockholm/tv/2configs/exim-smarthost.nix>
+ <stockholm/tv/2configs/retiolum.nix>
];
networking = {
diff --git a/tv/1systems/cd/source.nix b/tv/1systems/cd/source.nix
new file mode 100644
index 0000000..019e8bc
--- /dev/null
+++ b/tv/1systems/cd/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/tv/source.nix> {
+ name = "cd";
+}
diff --git a/tv/1systems/mu.nix b/tv/1systems/mu/config.nix
index 3f3b2c2..239f333 100644
--- a/tv/1systems/mu.nix
+++ b/tv/1systems/mu/config.nix
@@ -4,11 +4,11 @@ with import <stockholm/lib>;
{
imports = [
- ../../krebs
- ../2configs
- ../3modules
- ../2configs/exim-retiolum.nix
- ../2configs/retiolum.nix
+ <stockholm/krebs>
+ <stockholm/tv/2configs>
+ <stockholm/tv/3modules>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/retiolum.nix>
];
krebs.build.host = config.krebs.hosts.mu;
diff --git a/tv/1systems/mu/source.nix b/tv/1systems/mu/source.nix
new file mode 100644
index 0000000..7e148cf
--- /dev/null
+++ b/tv/1systems/mu/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/tv/source.nix> {
+ name = "mu";
+}
diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic/config.nix
index 9b95022..d014498 100644
--- a/tv/1systems/nomic.nix
+++ b/tv/1systems/nomic/config.nix
@@ -6,16 +6,16 @@ with import <stockholm/lib>;
krebs.build.host = config.krebs.hosts.nomic;
imports = [
- ../.
- ../2configs/hw/x220.nix
- ../2configs/exim-retiolum.nix
- ../2configs/gitrepos.nix
- ../2configs/im.nix
- ../2configs/mail-client.nix
- ../2configs/nginx/public_html.nix
- ../2configs/pulse.nix
- ../2configs/retiolum.nix
- ../2configs/xserver
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/x220.nix>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/gitrepos.nix>
+ <stockholm/tv/2configs/im.nix>
+ <stockholm/tv/2configs/mail-client.nix>
+ <stockholm/tv/2configs/nginx/public_html.nix>
+ <stockholm/tv/2configs/pulse.nix>
+ <stockholm/tv/2configs/retiolum.nix>
+ <stockholm/tv/2configs/xserver>
];
boot.initrd.luks = {
diff --git a/tv/1systems/nomic/source.nix b/tv/1systems/nomic/source.nix
new file mode 100644
index 0000000..f173b65
--- /dev/null
+++ b/tv/1systems/nomic/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/tv/source.nix> {
+ name = "nomic";
+ secure = true;
+}
diff --git a/tv/1systems/test/source.nix b/tv/1systems/test/source.nix
new file mode 100644
index 0000000..f756b85
--- /dev/null
+++ b/tv/1systems/test/source.nix
@@ -0,0 +1,3 @@
+import <stockholm/tv/source.nix> {
+ name = "test";
+}
diff --git a/tv/1systems/wu.nix b/tv/1systems/wu/config.nix
index 4b3bf85..5b2542a 100644
--- a/tv/1systems/wu.nix
+++ b/tv/1systems/wu/config.nix
@@ -6,17 +6,17 @@ with import <stockholm/lib>;
krebs.build.host = config.krebs.hosts.wu;
imports = [
- ../.
- ../2configs/hw/w110er.nix
- ../2configs/exim-retiolum.nix
- ../2configs/gitrepos.nix
- ../2configs/im.nix
- ../2configs/mail-client.nix
- ../2configs/man.nix
- ../2configs/nginx/public_html.nix
- ../2configs/pulse.nix
- ../2configs/retiolum.nix
- ../2configs/xserver
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/w110er.nix>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/gitrepos.nix>
+ <stockholm/tv/2configs/im.nix>
+ <stockholm/tv/2configs/mail-client.nix>
+ <stockholm/tv/2configs/man.nix>
+ <stockholm/tv/2configs/nginx/public_html.nix>
+ <stockholm/tv/2configs/pulse.nix>
+ <stockholm/tv/2configs/retiolum.nix>
+ <stockholm/tv/2configs/xserver>
{
environment.systemPackages = with pkgs; [
# root
diff --git a/tv/1systems/wu/source.nix b/tv/1systems/wu/source.nix
new file mode 100644
index 0000000..2e9cdeb
--- /dev/null
+++ b/tv/1systems/wu/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/tv/source.nix> {
+ name = "wu";
+ secure = true;
+}
diff --git a/tv/1systems/xu.nix b/tv/1systems/xu/config.nix
index d82f45a..2bffddd 100644
--- a/tv/1systems/xu.nix
+++ b/tv/1systems/xu/config.nix
@@ -6,18 +6,18 @@ with import <stockholm/lib>;
krebs.build.host = config.krebs.hosts.xu;
imports = [
- ../.
- ../2configs/hw/x220.nix
- ../2configs/exim-retiolum.nix
- ../2configs/gitconfig.nix
- ../2configs/gitrepos.nix
- ../2configs/mail-client.nix
- ../2configs/man.nix
- ../2configs/nginx/public_html.nix
- ../2configs/pulse.nix
- ../2configs/retiolum.nix
- ../2configs/binary-cache
- ../2configs/xserver
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/x220.nix>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/gitconfig.nix>
+ <stockholm/tv/2configs/gitrepos.nix>
+ <stockholm/tv/2configs/mail-client.nix>
+ <stockholm/tv/2configs/man.nix>
+ <stockholm/tv/2configs/nginx/public_html.nix>
+ <stockholm/tv/2configs/pulse.nix>
+ <stockholm/tv/2configs/retiolum.nix>
+ <stockholm/tv/2configs/binary-cache>
+ <stockholm/tv/2configs/xserver>
{
environment.systemPackages = with pkgs; [
diff --git a/tv/1systems/xu/source.nix b/tv/1systems/xu/source.nix
new file mode 100644
index 0000000..46e1aee
--- /dev/null
+++ b/tv/1systems/xu/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/tv/source.nix> {
+ name = "xu";
+ secure = true;
+}
diff --git a/tv/1systems/zu.nix b/tv/1systems/zu/config.nix
index 4fae3ca..d2aab8c 100644
--- a/tv/1systems/zu.nix
+++ b/tv/1systems/zu/config.nix
@@ -12,16 +12,16 @@ with import <stockholm/lib>;
default = {};
};
}
- ../.
- ../2configs/hw/x220.nix
- ../2configs/exim-retiolum.nix
- ../2configs/gitrepos.nix
- ../2configs/mail-client.nix
- ../2configs/man.nix
- ../2configs/nginx/public_html.nix
- ../2configs/pulse.nix
- ../2configs/retiolum.nix
- ../2configs/xserver
+ <stockholm/tv>
+ <stockholm/tv/2configs/hw/x220.nix>
+ <stockholm/tv/2configs/exim-retiolum.nix>
+ <stockholm/tv/2configs/gitrepos.nix>
+ <stockholm/tv/2configs/mail-client.nix>
+ <stockholm/tv/2configs/man.nix>
+ <stockholm/tv/2configs/nginx/public_html.nix>
+ <stockholm/tv/2configs/pulse.nix>
+ <stockholm/tv/2configs/retiolum.nix>
+ <stockholm/tv/2configs/xserver>
{
environment.systemPackages = with pkgs; [
diff --git a/tv/1systems/zu/source.nix b/tv/1systems/zu/source.nix
new file mode 100644
index 0000000..7a5c4f5
--- /dev/null
+++ b/tv/1systems/zu/source.nix
@@ -0,0 +1,4 @@
+import <stockholm/tv/source.nix> {
+ name = "zu";
+ secure = true;
+}
diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix
index 3d95d6d..07496fd 100644
--- a/tv/2configs/default.nix
+++ b/tv/2configs/default.nix
@@ -6,23 +6,7 @@ with import <stockholm/lib>;
in {
krebs.enable = true;
- krebs.build = {
- user = config.krebs.users.tv;
- source = let inherit (config.krebs.build) host; in {
- nixos-config.symlink = "stockholm/tv/1systems/${host.name}.nix";
- secrets.file = getAttr builder {
- buildbot = toString <stockholm/tv/dummy_secrets>;
- tv = "/home/tv/secrets/${host.name}";
- };
- secrets-common.file = "/home/tv/secrets/common";
- nixpkgs.git = {
- url = https://github.com/NixOS/nixpkgs;
- ref = "057f89b9344e5341796046f25ae4f269be6d4529"; # nixos-17.03
- };
- } // optionalAttrs host.secure {
- secrets-master.file = "/home/tv/secrets/master";
- };
- };
+ krebs.build.user = config.krebs.users.tv;
networking.hostName = config.krebs.build.host.name;
diff --git a/tv/2configs/hw/x220.nix b/tv/2configs/hw/x220.nix
index 6cc295d..e0a04e2 100644
--- a/tv/2configs/hw/x220.nix
+++ b/tv/2configs/hw/x220.nix
@@ -11,7 +11,7 @@
networking.wireless.enable = true;
# Required for Centrino.
- hardware.enableAllFirmware = true;
+ hardware.enableRedistributableFirmware = true;
hardware.opengl.extraPackages = [ pkgs.vaapiIntel pkgs.vaapiVdpau ];
diff --git a/tv/source.nix b/tv/source.nix
new file mode 100644
index 0000000..4ede976
--- /dev/null
+++ b/tv/source.nix
@@ -0,0 +1,27 @@
+with import <stockholm/lib>;
+host@{ name, secure ? false, override ? {} }: let
+ builder = if getEnv "dummy_secrets" == "true"
+ then "buildbot"
+ else "tv";
+ _file = <stockholm> + "/tv/1systems/${name}/source.nix";
+in
+ evalSource (toString _file) [
+ {
+ nixos-config.symlink = "stockholm/tv/1systems/${name}/config.nix";
+ nixpkgs.git = {
+ # nixos-17.03