From 981664337fef772422cbc3ca8bcb8ebb85d79b02 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 27 Jul 2015 21:36:15 +0200 Subject: [PATCH 1/6] default.nix: lib = import 4lib/krebs --- default.nix | 4 ++++ tv/lib/default.nix | 11 +++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/default.nix b/default.nix index 77c5ead22..b7468dbe7 100644 --- a/default.nix +++ b/default.nix @@ -1,8 +1,12 @@ { user-name, system-name }: let + lib = import 4lib/krebs { + lib = import ; + }; eval = import { + inherit lib; system = builtins.currentSystem; modules = map (p: ./. + "/${p}") [ "${user-name}/systems/${system-name}.nix" diff --git a/tv/lib/default.nix b/tv/lib/default.nix index e0a295f17..dbc0c29b7 100644 --- a/tv/lib/default.nix +++ b/tv/lib/default.nix @@ -1,16 +1,11 @@ { lib, pkgs, ... }: -let - krebs = import ../../4lib/krebs { inherit lib; }; -in +with lib; -with krebs; - -krebs // rec { +lib // rec { git = import ./git.nix { - lib = krebs; - inherit pkgs; + inherit lib pkgs; }; # "7.4.335" -> "74" From 2fd02838682d494336de3b32ab7b2dfae609dfcb Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 28 Jul 2015 19:56:53 +0200 Subject: [PATCH 2/6] cgit-retiolum: add private repos --- 2configs/makefu/cgit-retiolum.nix | 46 +++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/2configs/makefu/cgit-retiolum.nix b/2configs/makefu/cgit-retiolum.nix index d5ad35fda..7b8e3bc97 100644 --- a/2configs/makefu/cgit-retiolum.nix +++ b/2configs/makefu/cgit-retiolum.nix @@ -1,4 +1,5 @@ { config, lib, pkgs, ... }: +# TODO: remove tv lib :) with import ../../4lib/tv { inherit lib pkgs; }; let @@ -7,23 +8,31 @@ let krebs.git = { enable = true; root-title = "public repositories "; - root-desc = "keep calm and enrage"; - inherit repos rules ; + root-desc = "keep on krebsing"; + inherit repos rules; }; }; + repos = priv-repos // krebs-repos ; + rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos); - repos = public-repos; - rules = concatMap make-rules (attrValues repos); - - public-repos = mapAttrs make-public-repo { + krebs-repos = mapAttrs make-krebs-repo { stockholm = { desc = "take all the computers hostage, they'll love you!"; }; }; - # TODO move users to separate module + priv-repos = mapAttrs make-priv-repo { + autosync = { }; + }; - make-public-repo = name: { desc ? null, ... }: { + + # TODO move users to separate module + make-priv-repo = name: { desc ? null, ... }: { + inherit name desc; + public = false; + }; + + make-krebs-repo = with git; name: { desc ? null, ... }: { inherit name desc; public = true; hooks = { @@ -35,18 +44,27 @@ let }; }; - make-rules = - with git // config.krebs.users; - repo: + set-owners = with git; repo: user: singleton { - user = makefu; + inherit user; repo = [ repo ]; perm = push "refs/*" [ non-fast-forward create delete merge ]; - } ++ + }; + + set-ro-access = with git; repo: user: optional repo.public { - user = [ lass tv uriel ]; + inherit user; repo = [ repo ]; perm = fetch; }; + # TODO: get the list of all krebsministers + krebsminister = with config.krebs.users; [ lass tv uriel ]; + + priv-rules = with config.krebs.users; repo: + set-owners repo [ makefu ]; + + krebs-rules = with config.krebs.users; repo: + set-owners repo [ makefu ] ++ set-ro-access repo krebsminister ; + in out From 2de7a7f6b97d9976291bd8f8255a627695fb79fc Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 28 Jul 2015 19:59:02 +0200 Subject: [PATCH 3/6] identity: makefu add email --- 3modules/krebs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3modules/krebs/default.nix b/3modules/krebs/default.nix index 33c108811..3c2f7c9cb 100644 --- a/3modules/krebs/default.nix +++ b/3modules/krebs/default.nix @@ -104,7 +104,7 @@ let }; }; - makefu-imp = { + makefu-imp = { hosts = addNames { pnp = { cores = 1; @@ -133,6 +133,7 @@ let }; users = addNames { makefu = { + mail = "root@euer.krebsco.de"; pubkey = readFile ../../Zpubkeys/makefu_arch.ssh.pub; }; }; From 8170b281964688b542fb151054c5d86d819008b3 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Jul 2015 20:40:25 +0200 Subject: [PATCH 4/6] tv: reintroduce directory numbers --- default.nix | 4 ++-- tv/{systems => 1systems}/cd.nix | 16 +++++++-------- tv/{systems => 1systems}/mkdir.nix | 12 +++++------ tv/{systems => 1systems}/nomic.nix | 10 +++++----- tv/{systems => 1systems}/rmdir.nix | 12 +++++------ tv/{systems => 1systems}/wu.nix | 20 +++++++++---------- tv/{configs => 2configs}/AO753.nix | 2 +- .../CAC-CentOS-7-64bit.nix | 0 tv/{configs => 2configs}/CAC-Developer-1.nix | 0 tv/{configs => 2configs}/CAC-Developer-2.nix | 0 tv/{configs => 2configs}/base.nix | 0 tv/{configs => 2configs}/bash_completion.sh | 0 tv/{configs => 2configs}/charybdis.nix | 2 +- tv/{configs => 2configs}/consul-client.nix | 0 tv/{configs => 2configs}/consul-server.nix | 0 tv/{configs => 2configs}/cryptoroot.nix | 0 tv/{configs => 2configs}/exim-retiolum.nix | 0 tv/{configs => 2configs}/exim-smarthost.nix | 0 tv/{configs => 2configs}/git.nix | 2 +- tv/{configs => 2configs}/mail-client.nix | 2 +- tv/{configs => 2configs}/smartd.nix | 0 tv/{configs => 2configs}/synaptics.nix | 0 tv/{configs => 2configs}/urlwatch.nix | 0 tv/{configs => 2configs}/urxvt.nix | 0 tv/{configs => 2configs}/w110er.nix | 2 +- tv/{configs => 2configs}/xserver.nix | 2 +- tv/{modules => 3modules}/consul.nix | 2 +- tv/{modules => 3modules}/default.nix | 0 tv/{modules => 3modules}/ejabberd.nix | 0 tv/{modules => 3modules}/iptables.nix | 0 tv/{lib => 4lib}/default.nix | 0 tv/{lib => 4lib}/git.nix | 0 tv/{lib => 4lib}/modules.nix | 0 tv/{pkgs => 5pkgs}/charybdis/default.nix | 0 .../charybdis/remove-setenv.patch | 0 tv/{pkgs => 5pkgs}/default.nix | 0 tv/{pkgs => 5pkgs}/lentil/default.nix | 0 tv/{pkgs => 5pkgs}/lentil/syntaxes.patch | 0 tv/{pkgs => 5pkgs}/much.nix | 0 tv/{pkgs => 5pkgs}/viljetic-pages/default.nix | 0 tv/{pkgs => 5pkgs}/viljetic-pages/index.html | 0 tv/{pkgs => 5pkgs}/viljetic-pages/logo.xpm | 0 42 files changed, 44 insertions(+), 44 deletions(-) rename tv/{systems => 1systems}/cd.nix (91%) rename tv/{systems => 1systems}/mkdir.nix (87%) rename tv/{systems => 1systems}/nomic.nix (94%) rename tv/{systems => 1systems}/rmdir.nix (87%) rename tv/{systems => 1systems}/wu.nix (95%) rename tv/{configs => 2configs}/AO753.nix (95%) rename tv/{configs => 2configs}/CAC-CentOS-7-64bit.nix (100%) rename tv/{configs => 2configs}/CAC-Developer-1.nix (100%) rename tv/{configs => 2configs}/CAC-Developer-2.nix (100%) rename tv/{configs => 2configs}/base.nix (100%) rename tv/{configs => 2configs}/bash_completion.sh (100%) rename tv/{configs => 2configs}/charybdis.nix (99%) rename tv/{configs => 2configs}/consul-client.nix (100%) rename tv/{configs => 2configs}/consul-server.nix (100%) rename tv/{configs => 2configs}/cryptoroot.nix (100%) rename tv/{configs => 2configs}/exim-retiolum.nix (100%) rename tv/{configs => 2configs}/exim-smarthost.nix (100%) rename tv/{configs => 2configs}/git.nix (97%) rename tv/{configs => 2configs}/mail-client.nix (76%) rename tv/{configs => 2configs}/smartd.nix (100%) rename tv/{configs => 2configs}/synaptics.nix (100%) rename tv/{configs => 2configs}/urlwatch.nix (100%) rename tv/{configs => 2configs}/urxvt.nix (100%) rename tv/{configs => 2configs}/w110er.nix (97%) rename tv/{configs => 2configs}/xserver.nix (96%) rename tv/{modules => 3modules}/consul.nix (98%) rename tv/{modules => 3modules}/default.nix (100%) rename tv/{modules => 3modules}/ejabberd.nix (100%) rename tv/{modules => 3modules}/iptables.nix (100%) rename tv/{lib => 4lib}/default.nix (100%) rename tv/{lib => 4lib}/git.nix (100%) rename tv/{lib => 4lib}/modules.nix (100%) rename tv/{pkgs => 5pkgs}/charybdis/default.nix (100%) rename tv/{pkgs => 5pkgs}/charybdis/remove-setenv.patch (100%) rename tv/{pkgs => 5pkgs}/default.nix (100%) rename tv/{pkgs => 5pkgs}/lentil/default.nix (100%) rename tv/{pkgs => 5pkgs}/lentil/syntaxes.patch (100%) rename tv/{pkgs => 5pkgs}/much.nix (100%) rename tv/{pkgs => 5pkgs}/viljetic-pages/default.nix (100%) rename tv/{pkgs => 5pkgs}/viljetic-pages/index.html (100%) rename tv/{pkgs => 5pkgs}/viljetic-pages/logo.xpm (100%) diff --git a/default.nix b/default.nix index b7468dbe7..322566f6a 100644 --- a/default.nix +++ b/default.nix @@ -9,8 +9,8 @@ let inherit lib; system = builtins.currentSystem; modules = map (p: ./. + "/${p}") [ - "${user-name}/systems/${system-name}.nix" - "${user-name}/modules" + "${user-name}/1systems/${system-name}.nix" + "${user-name}/3modules" "3modules/krebs" ]; }; diff --git a/tv/systems/cd.nix b/tv/1systems/cd.nix similarity index 91% rename from tv/systems/cd.nix rename to tv/1systems/cd.nix index 037248c49..54292eb83 100644 --- a/tv/systems/cd.nix +++ b/tv/1systems/cd.nix @@ -3,7 +3,7 @@ with lib; let - tvpkgs = import ../pkgs { inherit pkgs; }; + tvpkgs = import ../5pkgs { inherit pkgs; }; in { @@ -26,14 +26,14 @@ in }; imports = [ - ../configs/CAC-Developer-2.nix - ../configs/CAC-CentOS-7-64bit.nix - ../configs/base.nix - ../configs/consul-server.nix - ../configs/exim-smarthost.nix - ../configs/git.nix + ../2configs/CAC-Developer-2.nix + ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/base.nix + ../2configs/consul-server.nix + ../2configs/exim-smarthost.nix + ../2configs/git.nix { - imports = [ ../configs/charybdis.nix ]; + imports = [ ../2configs/charybdis.nix ]; tv.charybdis = { enable = true; sslCert = ../../Zcerts/charybdis_cd.crt.pem; diff --git a/tv/systems/mkdir.nix b/tv/1systems/mkdir.nix similarity index 87% rename from tv/systems/mkdir.nix rename to tv/1systems/mkdir.nix index f601ec838..cd3d3b5c4 100644 --- a/tv/systems/mkdir.nix +++ b/tv/1systems/mkdir.nix @@ -22,12 +22,12 @@ with lib; }; imports = [ - ../configs/CAC-Developer-1.nix - ../configs/CAC-CentOS-7-64bit.nix - ../configs/base.nix - ../configs/consul-server.nix - ../configs/exim-smarthost.nix - ../configs/git.nix + ../2configs/CAC-Developer-1.nix + ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/base.nix + ../2configs/consul-server.nix + ../2configs/exim-smarthost.nix + ../2configs/git.nix { tv.iptables = { enable = true; diff --git a/tv/systems/nomic.nix b/tv/1systems/nomic.nix similarity index 94% rename from tv/systems/nomic.nix rename to tv/1systems/nomic.nix index c96fe3811..b9a10cb4f 100644 --- a/tv/systems/nomic.nix +++ b/tv/1systems/nomic.nix @@ -22,11 +22,11 @@ with lib; }; imports = [ - ../configs/AO753.nix - ../configs/base.nix - ../configs/consul-server.nix - ../configs/exim-retiolum.nix - ../configs/git.nix + ../2configs/AO753.nix + ../2configs/base.nix + ../2configs/consul-server.nix + ../2configs/exim-retiolum.nix + ../2configs/git.nix { tv.iptables = { enable = true; diff --git a/tv/systems/rmdir.nix b/tv/1systems/rmdir.nix similarity index 87% rename from tv/systems/rmdir.nix rename to tv/1systems/rmdir.nix index fa91516d9..c8ac43e4c 100644 --- a/tv/systems/rmdir.nix +++ b/tv/1systems/rmdir.nix @@ -22,12 +22,12 @@ with lib; }; imports = [ - ../configs/CAC-Developer-1.nix - ../configs/CAC-CentOS-7-64bit.nix - ../configs/base.nix - ../configs/consul-server.nix - ../configs/exim-smarthost.nix - ../configs/git.nix + ../2configs/CAC-Developer-1.nix + ../2configs/CAC-CentOS-7-64bit.nix + ../2configs/base.nix + ../2configs/consul-server.nix + ../2configs/exim-smarthost.nix + ../2configs/git.nix { tv.iptables = { enable = true; diff --git a/tv/systems/wu.nix b/tv/1systems/wu.nix similarity index 95% rename from tv/systems/wu.nix rename to tv/1systems/wu.nix index 7c52d9484..27691ec56 100644 --- a/tv/systems/wu.nix +++ b/tv/1systems/wu.nix @@ -3,7 +3,7 @@ with lib; let - tvpkgs = import ../pkgs { inherit pkgs; }; + tvpkgs = import ../5pkgs { inherit pkgs; }; in { @@ -26,15 +26,15 @@ in }; imports = [ - ../configs/w110er.nix - ../configs/base.nix - ../configs/consul-client.nix - ../configs/exim-retiolum.nix - ../configs/git.nix - ../configs/mail-client.nix - ../configs/xserver.nix - ../configs/synaptics.nix # TODO w110er if xserver is enabled - ../configs/urlwatch.nix + ../2configs/w110er.nix + ../2configs/base.nix + ../2configs/consul-client.nix + ../2configs/exim-retiolum.nix + ../2configs/git.nix + ../2configs/mail-client.nix + ../2configs/xserver.nix + ../2configs/synaptics.nix # TODO w110er if xserver is enabled + ../2configs/urlwatch.nix { environment.systemPackages = with pkgs; [ diff --git a/tv/configs/AO753.nix b/tv/2configs/AO753.nix similarity index 95% rename from tv/configs/AO753.nix rename to tv/2configs/AO753.nix index c103ce2d7..96167ce01 100644 --- a/tv/configs/AO753.nix +++ b/tv/2configs/AO753.nix @@ -2,7 +2,7 @@ { imports = [ - ../configs/smartd.nix + ../2configs/smartd.nix ]; boot.loader.grub = { diff --git a/tv/configs/CAC-CentOS-7-64bit.nix b/tv/2configs/CAC-CentOS-7-64bit.nix similarity index 100% rename from tv/configs/CAC-CentOS-7-64bit.nix rename to tv/2configs/CAC-CentOS-7-64bit.nix diff --git a/tv/configs/CAC-Developer-1.nix b/tv/2configs/CAC-Developer-1.nix similarity index 100% rename from tv/configs/CAC-Developer-1.nix rename to tv/2configs/CAC-Developer-1.nix diff --git a/tv/configs/CAC-Developer-2.nix b/tv/2configs/CAC-Developer-2.nix similarity index 100% rename from tv/configs/CAC-Developer-2.nix rename to tv/2configs/CAC-Developer-2.nix diff --git a/tv/configs/base.nix b/tv/2configs/base.nix similarity index 100% rename from tv/configs/base.nix rename to tv/2configs/base.nix diff --git a/tv/configs/bash_completion.sh b/tv/2configs/bash_completion.sh similarity index 100% rename from tv/configs/bash_completion.sh rename to tv/2configs/bash_completion.sh diff --git a/tv/configs/charybdis.nix b/tv/2configs/charybdis.nix similarity index 99% rename from tv/configs/charybdis.nix rename to tv/2configs/charybdis.nix index 977626d27..bf45bf294 100644 --- a/tv/configs/charybdis.nix +++ b/tv/2configs/charybdis.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - tvpkgs = import ../pkgs { inherit pkgs; }; + tvpkgs = import ../5pkgs { inherit pkgs; }; in with builtins; diff --git a/tv/configs/consul-client.nix b/tv/2configs/consul-client.nix similarity index 100% rename from tv/configs/consul-client.nix rename to tv/2configs/consul-client.nix diff --git a/tv/configs/consul-server.nix b/tv/2configs/consul-server.nix similarity index 100% rename from tv/configs/consul-server.nix rename to tv/2configs/consul-server.nix diff --git a/tv/configs/cryptoroot.nix b/tv/2configs/cryptoroot.nix similarity index 100% rename from tv/configs/cryptoroot.nix rename to tv/2configs/cryptoroot.nix diff --git a/tv/configs/exim-retiolum.nix b/tv/2configs/exim-retiolum.nix similarity index 100% rename from tv/configs/exim-retiolum.nix rename to tv/2configs/exim-retiolum.nix diff --git a/tv/configs/exim-smarthost.nix b/tv/2configs/exim-smarthost.nix similarity index 100% rename from tv/configs/exim-smarthost.nix rename to tv/2configs/exim-smarthost.nix diff --git a/tv/configs/git.nix b/tv/2configs/git.nix similarity index 97% rename from tv/configs/git.nix rename to tv/2configs/git.nix index 01d29012c..ecb98cef2 100644 --- a/tv/configs/git.nix +++ b/tv/2configs/git.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: -with import ../lib { inherit lib pkgs; }; +with import ../4lib { inherit lib pkgs; }; let out = { diff --git a/tv/configs/mail-client.nix b/tv/2configs/mail-client.nix similarity index 76% rename from tv/configs/mail-client.nix rename to tv/2configs/mail-client.nix index 035f296b9..a632cf7c4 100644 --- a/tv/configs/mail-client.nix +++ b/tv/2configs/mail-client.nix @@ -1,6 +1,6 @@ { pkgs, ... }: -with import ../pkgs { inherit pkgs; }; +with import ../5pkgs { inherit pkgs; }; { environment.systemPackages = [ diff --git a/tv/configs/smartd.nix b/tv/2configs/smartd.nix similarity index 100% rename from tv/configs/smartd.nix rename to tv/2configs/smartd.nix diff --git a/tv/configs/synaptics.nix b/tv/2configs/synaptics.nix similarity index 100% rename from tv/configs/synaptics.nix rename to tv/2configs/synaptics.nix diff --git a/tv/configs/urlwatch.nix b/tv/2configs/urlwatch.nix similarity index 100% rename from tv/configs/urlwatch.nix rename to tv/2configs/urlwatch.nix diff --git a/tv/configs/urxvt.nix b/tv/2configs/urxvt.nix similarity index 100% rename from tv/configs/urxvt.nix rename to tv/2configs/urxvt.nix diff --git a/tv/configs/w110er.nix b/tv/2configs/w110er.nix similarity index 97% rename from tv/configs/w110er.nix rename to tv/2configs/w110er.nix index 96ee8c75b..e580b2161 100644 --- a/tv/configs/w110er.nix +++ b/tv/2configs/w110er.nix @@ -2,7 +2,7 @@ { imports = [ - ../configs/smartd.nix + ../2configs/smartd.nix ]; boot.extraModprobeConfig = '' diff --git a/tv/configs/xserver.nix b/tv/2configs/xserver.nix similarity index 96% rename from tv/configs/xserver.nix rename to tv/2configs/xserver.nix index ec94359ee..7fc07f927 100644 --- a/tv/configs/xserver.nix +++ b/tv/2configs/xserver.nix @@ -2,7 +2,7 @@ { imports = [ - ../configs/urxvt.nix # TODO via xserver + ../2configs/urxvt.nix # TODO via xserver ]; services.xserver.enable = true; diff --git a/tv/modules/consul.nix b/tv/3modules/consul.nix similarity index 98% rename from tv/modules/consul.nix rename to tv/3modules/consul.nix index 83a430c2f..82a15c024 100644 --- a/tv/modules/consul.nix +++ b/tv/3modules/consul.nix @@ -5,7 +5,7 @@ # TODO consul-bootstrap HOST that actually does is # TODO tools to inspect state of a cluster in outage state -with import ../lib { inherit lib pkgs; }; +with import ../4lib { inherit lib pkgs; }; let cfg = config.tv.consul; diff --git a/tv/modules/default.nix b/tv/3modules/default.nix similarity index 100% rename from tv/modules/default.nix rename to tv/3modules/default.nix diff --git a/tv/modules/ejabberd.nix b/tv/3modules/ejabberd.nix similarity index 100% rename from tv/modules/ejabberd.nix rename to tv/3modules/ejabberd.nix diff --git a/tv/modules/iptables.nix b/tv/3modules/iptables.nix similarity index 100% rename from tv/modules/iptables.nix rename to tv/3modules/iptables.nix diff --git a/tv/lib/default.nix b/tv/4lib/default.nix similarity index 100% rename from tv/lib/default.nix rename to tv/4lib/default.nix diff --git a/tv/lib/git.nix b/tv/4lib/git.nix similarity index 100% rename from tv/lib/git.nix rename to tv/4lib/git.nix diff --git a/tv/lib/modules.nix b/tv/4lib/modules.nix similarity index 100% rename from tv/lib/modules.nix rename to tv/4lib/modules.nix diff --git a/tv/pkgs/charybdis/default.nix b/tv/5pkgs/charybdis/default.nix similarity index 100% rename from tv/pkgs/charybdis/default.nix rename to tv/5pkgs/charybdis/default.nix diff --git a/tv/pkgs/charybdis/remove-setenv.patch b/tv/5pkgs/charybdis/remove-setenv.patch similarity index 100% rename from tv/pkgs/charybdis/remove-setenv.patch rename to tv/5pkgs/charybdis/remove-setenv.patch diff --git a/tv/pkgs/default.nix b/tv/5pkgs/default.nix similarity index 100% rename from tv/pkgs/default.nix rename to tv/5pkgs/default.nix diff --git a/tv/pkgs/lentil/default.nix b/tv/5pkgs/lentil/default.nix similarity index 100% rename from tv/pkgs/lentil/default.nix rename to tv/5pkgs/lentil/default.nix diff --git a/tv/pkgs/lentil/syntaxes.patch b/tv/5pkgs/lentil/syntaxes.patch similarity index 100% rename from tv/pkgs/lentil/syntaxes.patch rename to tv/5pkgs/lentil/syntaxes.patch diff --git a/tv/pkgs/much.nix b/tv/5pkgs/much.nix similarity index 100% rename from tv/pkgs/much.nix rename to tv/5pkgs/much.nix diff --git a/tv/pkgs/viljetic-pages/default.nix b/tv/5pkgs/viljetic-pages/default.nix similarity index 100% rename from tv/pkgs/viljetic-pages/default.nix rename to tv/5pkgs/viljetic-pages/default.nix diff --git a/tv/pkgs/viljetic-pages/index.html b/tv/5pkgs/viljetic-pages/index.html similarity index 100% rename from tv/pkgs/viljetic-pages/index.html rename to tv/5pkgs/viljetic-pages/index.html diff --git a/tv/pkgs/viljetic-pages/logo.xpm b/tv/5pkgs/viljetic-pages/logo.xpm similarity index 100% rename from tv/pkgs/viljetic-pages/logo.xpm rename to tv/5pkgs/viljetic-pages/logo.xpm From f98248672e1aeacf5d6665d252ce251fe1703249 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Jul 2015 21:00:53 +0200 Subject: [PATCH 5/6] Revert "default.nix: lib = import 4lib/krebs" This reverts commit 981664337fef772422cbc3ca8bcb8ebb85d79b02 --- default.nix | 4 ---- tv/4lib/default.nix | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index 322566f6a..0ee1c3d05 100644 --- a/default.nix +++ b/default.nix @@ -1,12 +1,8 @@ { user-name, system-name }: let - lib = import 4lib/krebs { - lib = import ; - }; eval = import { - inherit lib; system = builtins.currentSystem; modules = map (p: ./. + "/${p}") [ "${user-name}/1systems/${system-name}.nix" diff --git a/tv/4lib/default.nix b/tv/4lib/default.nix index dbc0c29b7..e0a295f17 100644 --- a/tv/4lib/default.nix +++ b/tv/4lib/default.nix @@ -1,11 +1,16 @@ { lib, pkgs, ... }: -with lib; +let + krebs = import ../../4lib/krebs { inherit lib; }; +in -lib // rec { +with krebs; + +krebs // rec { git = import ./git.nix { - inherit lib pkgs; + lib = krebs; + inherit pkgs; }; # "7.4.335" -> "74" From 3228890813535514dfdfe9d049486a9e6054e479 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Jul 2015 21:03:49 +0200 Subject: [PATCH 6/6] Makefile: become user top-level aware --- Makefile | 85 ++++++++------------------------------------------------ 1 file changed, 12 insertions(+), 73 deletions(-) diff --git a/Makefile b/Makefile index 6d075e6f2..ca828fd2b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # usage: # make system=foo # make systems='foo bar' -# make eval system=foo get=config.networking.extraHosts +# make eval system=foo get=config.networking.extraHosts [filter=json] # .ONESHELL: @@ -17,91 +17,30 @@ $(systems): --tagstring {} \ -q make systems= system={} ::: $(systems) else ifdef system -include 0make/$(LOGNAME)/$(system).makefile .PHONY: deploy deploy:;@ - system_name=$(system) - deploy_host=$(deploy_host) - nixpkgs_url=$(nixpkgs_url) - nixpkgs_rev=$(nixpkgs_rev) - secrets_dir=$(secrets_dir) - - prepush(){( - dst=$$1 - src=$$2 - rsync \ - --exclude .git \ - --exclude .graveyard \ - --exclude old \ - --rsync-path="mkdir -p \"$$dst\" && rsync" \ - --usermap=\*:0 \ - --groupmap=\*:0 \ - --delete-excluded \ - -vrLptgoD \ - "$$src/" "$$deploy_host:$$dst" - )} - - prepush /root/src/stockholm "$$PWD" - prepush /root/src/secrets "$$secrets_dir" - - ssh -S none "$$deploy_host" -T env \ - nixpkgs_url="$$nixpkgs_url" \ - nixpkgs_rev="$$nixpkgs_rev" \ - system_name="$$system_name" \ - user_name="$$LOGNAME" \ - sh -euf \ - <<-\EOF - prefetch(){( - dst=$$1 - url=$$2 - rev=$$3 - mkdir -p "$$dst" - cd "$$dst" - if ! test -e .git; then - git init - fi - if ! cur_url=$$(git config remote.origin.url 2>/dev/null); then - git remote add origin "$$url" - elif test "$$cur_url" != "$$url"; then - git remote set-url origin "$$url" - fi - if test "$$(git rev-parse --verify HEAD 2>/dev/null)" != "$$rev"; then - git fetch origin - git checkout "$$rev" -- . - git checkout -q "$$rev" - git submodule init - git submodule update - fi - git clean -dxf - )} - - prefetch /root/src/nixpkgs "$$nixpkgs_url" "$$nixpkgs_rev" - - echo build system... - NIX_PATH=/root/src \ - nix-build \ - -Q \ - -A system \ - '' \ - --argstr user-name "$$user_name" \ - --argstr system-name "$$system_name" - - result/bin/switch-to-configuration switch - EOF + make eval system=$(system) get=config.krebs.build.script filter=json | sh .PHONY: eval eval: @ +ifeq ($(filter),json) + extraArgs=--json + filter() { jq -r .; } +else + filter() { cat; } +endif NIX_PATH=stockholm=$$PWD:$$NIX_PATH \ nix-instantiate \ - --json \ + $${extraArgs-} \ + $${json+--json} \ + $${json+--strict} \ --eval \ - --strict \ -A "$$get" \ '' \ --argstr user-name "$$LOGNAME" \ --argstr system-name "$$system" \ - | jq -r . + | filter else $(error unbound variable: system[s]) endif