summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-07-24 17:34:08 +0200
committertv <tv@krebsco.de>2015-07-24 17:34:08 +0200
commit4165440f467e2c573ba248ae9cdcae54d1488bc5 (patch)
treece70c6d0d92d10a27dbadea313215b7953725b89
parent1fa2d83e3cdd3305fde7751d0c3ae64d5f8fed48 (diff)
autoimport 3*/{krebs,$(LOGNAME)}
-rw-r--r--1systems/tv/cd.nix12
-rw-r--r--1systems/tv/mkdir.nix2
-rw-r--r--1systems/tv/nomic.nix3
-rw-r--r--1systems/tv/rmdir.nix2
-rw-r--r--1systems/tv/wu.nix6
-rw-r--r--2configs/tv/consul-server.nix1
-rw-r--r--2configs/tv/git-public.nix1
-rw-r--r--2configs/tv/identity.nix1
-rw-r--r--3modules/krebs/default.nix11
-rw-r--r--3modules/tv/consul.nix1
-rw-r--r--3modules/tv/default.nix10
-rw-r--r--Makefile27
12 files changed, 38 insertions, 39 deletions
diff --git a/1systems/tv/cd.nix b/1systems/tv/cd.nix
index bf556e0..b15b189 100644
--- a/1systems/tv/cd.nix
+++ b/1systems/tv/cd.nix
@@ -22,14 +22,12 @@ in
};
}
{
- imports = [ ../../3modules/tv/ejabberd.nix ];
tv.ejabberd = {
enable = true;
hosts = [ "jabber.viljetic.de" ];
};
}
{
- imports = [ ../../3modules/krebs/github-hosts-sync.nix ];
krebs.github-hosts-sync.enable = true;
tv.iptables.input-internet-accept-new-tcp =
singleton config.krebs.github-hosts-sync.port;
@@ -39,7 +37,6 @@ in
tv.identity.self = config.tv.identity.hosts.cd;
}
{
- imports = [ ../../3modules/tv/iptables.nix ];
tv.iptables = {
enable = true;
input-internet-accept-new-tcp = [
@@ -55,19 +52,11 @@ in
};
}
{
- imports = [
- ../../3modules/tv/iptables.nix
- ../../3modules/krebs/nginx.nix
- ];
tv.iptables.input-internet-accept-new-tcp = singleton "http";
krebs.nginx.servers.cgit.server-names = singleton "cgit.cd.viljetic.de";
}
{
# TODO make public_html also available to cd, cd.retiolum (AKA default)
- imports = [
- ../../3modules/tv/iptables.nix
- ../../3modules/krebs/nginx.nix
- ];
tv.iptables.input-internet-accept-new-tcp = singleton "http";
krebs.nginx.servers.public_html = {
server-names = singleton "cd.viljetic.de";
@@ -86,7 +75,6 @@ in
};
}
{
- imports = [ ../../3modules/krebs/retiolum.nix ];
krebs.retiolum = {
enable = true;
connectTo = [
diff --git a/1systems/tv/mkdir.nix b/1systems/tv/mkdir.nix
index 823f044..03d0c00 100644
--- a/1systems/tv/mkdir.nix
+++ b/1systems/tv/mkdir.nix
@@ -15,7 +15,6 @@ with lib;
tv.identity.self = config.tv.identity.hosts.mkdir;
}
{
- imports = [ ../../3modules/tv/iptables.nix ];
tv.iptables = {
enable = true;
input-internet-accept-new-tcp = [
@@ -29,7 +28,6 @@ with lib;
};
}
{
- imports = [ ../../3modules/krebs/retiolum.nix ];
krebs.retiolum = {
enable = true;
connectTo = [
diff --git a/1systems/tv/nomic.nix b/1systems/tv/nomic.nix
index ef4a5ca..367502e 100644
--- a/1systems/tv/nomic.nix
+++ b/1systems/tv/nomic.nix
@@ -14,7 +14,6 @@ with lib;
tv.identity.self = config.tv.identity.hosts.nomic;
}
{
- imports = [ ../../3modules/tv/iptables.nix ];
tv.iptables = {
enable = true;
input-internet-accept-new-tcp = [
@@ -26,7 +25,6 @@ with lib;
};
}
{
- imports = [ ../../3modules/krebs/nginx.nix ];
krebs.nginx = {
enable = true;
servers.default.locations = [
@@ -37,7 +35,6 @@ with lib;
};
}
{
- imports = [ ../../3modules/krebs/retiolum.nix ];
krebs.retiolum = {
enable = true;
connectTo = [
diff --git a/1systems/tv/rmdir.nix b/1systems/tv/rmdir.nix
index f15c790..497354e 100644
--- a/1systems/tv/rmdir.nix
+++ b/1systems/tv/rmdir.nix
@@ -15,7 +15,6 @@ with lib;
tv.identity.self = config.tv.identity.hosts.rmdir;
}
{
- imports = [ ../../3modules/tv/iptables.nix ];
tv.iptables = {
enable = true;
input-internet-accept-new-tcp = [
@@ -29,7 +28,6 @@ with lib;
};
}
{
- imports = [ ../../3modules/krebs/retiolum.nix ];
krebs.retiolum = {
enable = true;
connectTo = [
diff --git a/1systems/tv/wu.nix b/1systems/tv/wu.nix
index 0b5b828..8470a4f 100644
--- a/1systems/tv/wu.nix
+++ b/1systems/tv/wu.nix
@@ -24,7 +24,7 @@ in
{
environment.systemPackages = with pkgs; [
- # shitment
+ # stockholm
git
gnumake
parallel
@@ -122,7 +122,6 @@ in
];
}
{
- imports = [ ../../3modules/tv/iptables.nix ];
tv.iptables = {
enable = true;
input-internet-accept-new-tcp = [
@@ -134,7 +133,6 @@ in
};
}
{
- imports = [ ../../3modules/krebs/nginx.nix ];
krebs.nginx = {
enable = true;
servers.default.locations = [
@@ -145,7 +143,6 @@ in
};
}
{
- imports = [ ../../3modules/krebs/retiolum.nix ];
krebs.retiolum = {
enable = true;
connectTo = [
@@ -155,7 +152,6 @@ in
};
}
{
- imports = [ ../../3modules/krebs/urlwatch.nix ];
krebs.urlwatch = {
enable = true;
mailto = "tv@wu.retiolum"; # TODO
diff --git a/2configs/tv/consul-server.nix b/2configs/tv/consul-server.nix
index 1c8dcb8..5d3fd55 100644
--- a/2configs/tv/consul-server.nix
+++ b/2configs/tv/consul-server.nix
@@ -1,7 +1,6 @@
{ config, ... }:
{
- imports = [ ../../3modules/tv/consul.nix ];
tv.consul = rec {
enable = true;
diff --git a/2configs/tv/git-public.nix b/2configs/tv/git-public.nix
index 7f2b513..1bf44e0 100644
--- a/2configs/tv/git-public.nix
+++ b/2configs/tv/git-public.nix
@@ -3,7 +3,6 @@ with import ../../4lib/tv { inherit lib pkgs; };
let
out = {
- imports = [ ../../3modules/krebs/git.nix ];
krebs.git = {
enable = true;
root-title = "public repositories at ${config.tv.identity.self.name}";
diff --git a/2configs/tv/identity.nix b/2configs/tv/identity.nix
index 44208c9..bcfdc29 100644
--- a/2configs/tv/identity.nix
+++ b/2configs/tv/identity.nix
@@ -1,7 +1,6 @@
{ config, ... }:
{
- imports = [ ../../3modules/tv/identity.nix ];
tv.identity = {
enable = true;
search = "retiolum";
diff --git a/3modules/krebs/default.nix b/3modules/krebs/default.nix
new file mode 100644
index 0000000..fe94e09
--- /dev/null
+++ b/3modules/krebs/default.nix
@@ -0,0 +1,11 @@
+_:
+
+{
+ imports = [
+ ./github-hosts-sync.nix
+ ./git.nix
+ ./nginx.nix
+ ./retiolum.nix
+ ./urlwatch.nix
+ ];
+}
diff --git a/3modules/tv/consul.nix b/3modules/tv/consul.nix
index 312faa0..4e54c2a 100644
--- a/3modules/tv/consul.nix
+++ b/3modules/tv/consul.nix
@@ -10,7 +10,6 @@ let
cfg = config.tv.consul;
out = {
- imports = [ ../../3modules/tv/iptables.nix ];
options.tv.consul = api;
config = mkIf cfg.enable (mkMerge [
imp
diff --git a/3modules/tv/default.nix b/3modules/tv/default.nix
new file mode 100644
index 0000000..e267d0b
--- /dev/null
+++ b/3modules/tv/default.nix
@@ -0,0 +1,10 @@
+_:
+
+{
+ imports = [
+ ./consul.nix
+ ./ejabberd.nix
+ ./identity.nix
+ ./iptables.nix
+ ];
+}
diff --git a/Makefile b/Makefile
index da23467..6d075e6 100644
--- a/Makefile
+++ b/Makefile
@@ -41,13 +41,14 @@ deploy:;@
"$$src/" "$$deploy_host:$$dst"
)}
- prepush /root/src/shitment "$$PWD"
+ 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(){(
@@ -77,26 +78,30 @@ deploy:;@
prefetch /root/src/nixpkgs "$$nixpkgs_url" "$$nixpkgs_rev"
echo build system...
- NIXOS_CONFIG=/root/src/shitment/1systems/$(LOGNAME)/$$system_name.nix \
- NIX_PATH=src \
- nix-build -Q -A system '<nixpkgs/nixos>'
+ NIX_PATH=/root/src \
+ nix-build \
+ -Q \
+ -A system \
+ '<stockholm>' \
+ --argstr user-name "$$user_name" \
+ --argstr system-name "$$system_name"
result/bin/switch-to-configuration switch
EOF
.PHONY: eval
eval:
- @nix-instantiate \
+ @
+ NIX_PATH=stockholm=$$PWD:$$NIX_PATH \
+ nix-instantiate \
--json \
--eval \
--strict \
-A "$$get" \
- -E '
- import <nixpkgs/nixos/lib/eval-config.nix> {
- system = builtins.currentSystem;
- modules = [ ./1systems/$(LOGNAME)/$(system).nix ];
- }
- ' | jq -r .
+ '<stockholm>' \
+ --argstr user-name "$$LOGNAME" \
+ --argstr system-name "$$system" \
+ | jq -r .
else
$(error unbound variable: system[s])
endif