From 2b9d7bdda10689e8bd8f7ed39830fd274c02457b Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 14 Nov 2015 01:49:31 +0100 Subject: m 1 gum: add swap to server config --- makefu/2configs/fs/simple-swap.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 makefu/2configs/fs/simple-swap.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/fs/simple-swap.nix b/makefu/2configs/fs/simple-swap.nix new file mode 100644 index 000000000..8c161b287 --- /dev/null +++ b/makefu/2configs/fs/simple-swap.nix @@ -0,0 +1,11 @@ +_: +{ + # do not swap that often + boot.kernel.sysctl = { + "vm.swappiness" = 25; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; +} -- cgit v1.2.3 From 79b890670100d08c3640fffade2caf3eced192d8 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 14 Nov 2015 01:50:24 +0100 Subject: m 2 vbox: up version number --- makefu/2configs/main-laptop.nix | 2 +- makefu/2configs/virtualization-virtualbox.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/main-laptop.nix b/makefu/2configs/main-laptop.nix index 294ee7510..dfc8c1c07 100644 --- a/makefu/2configs/main-laptop.nix +++ b/makefu/2configs/main-laptop.nix @@ -12,7 +12,7 @@ with lib; firefox chromium keepassx - + ntfs3g virtmanager at_spi2_core # dep for virtmanager? ]; diff --git a/makefu/2configs/virtualization-virtualbox.nix b/makefu/2configs/virtualization-virtualbox.nix index 610b63732..aaabcd50e 100644 --- a/makefu/2configs/virtualization-virtualbox.nix +++ b/makefu/2configs/virtualization-virtualbox.nix @@ -2,11 +2,11 @@ let mainUser = config.krebs.build.user; - version = "5.0.4"; - rev = "102546"; + version = "5.0.6"; + rev = "103037"; vboxguestpkg = pkgs.fetchurl { url = "http://download.virtualbox.org/virtualbox/${version}/Oracle_VM_VirtualBox_Extension_Pack-${version}-${rev}.vbox-extpack"; - sha256 = "1ykwpjvfgj11iwhx70bh2hbxhyy3hg6rnqzl4qac7xzg8xw8wqg4"; + sha256 = "1dc70x2m7x266zzw5vw36mxqj7xykkbk357fc77f9zrv4lylzvaf"; }; in { #inherit vboxguestpkg; -- cgit v1.2.3 From 4fec1920fb8fb9392c7a5c363a8392230eb64de8 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2015 13:55:30 +0100 Subject: m 2 git: fix library and irc hooks --- makefu/2configs/git/brain-retiolum.nix | 4 +-- makefu/2configs/git/cgit-retiolum.nix | 46 +++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 17 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/brain-retiolum.nix b/makefu/2configs/git/brain-retiolum.nix index 793373859..066d50a28 100644 --- a/makefu/2configs/git/brain-retiolum.nix +++ b/makefu/2configs/git/brain-retiolum.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: # TODO: remove tv lib :) -with import ../../../tv/4lib { inherit lib pkgs; }; +with lib; let repos = priv-repos // krebs-repos ; @@ -26,7 +26,7 @@ let inherit name desc; public = false; hooks = { - post-receive = git.irc-announce { + post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; channel = "#retiolum"; # TODO remove the hardcoded hostname diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 189dd66c8..748cd6427 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -1,10 +1,12 @@ { config, lib, pkgs, ... }: # TODO: remove tv lib :) -with import ../../../tv/4lib { inherit lib pkgs; }; +with lib; let - repos = priv-repos // krebs-repos ; - rules = concatMap krebs-rules (attrValues krebs-repos) ++ concatMap priv-rules (attrValues priv-repos); + repos = priv-repos // krebs-repos // connector-repos ; + rules = concatMap krebs-rules (attrValues krebs-repos) + ++ concatMap priv-rules (attrValues priv-repos) + ++ concatMap connector-rules (attrValues connector-repos); krebs-repos = mapAttrs make-krebs-repo { stockholm = { @@ -19,6 +21,10 @@ let autosync = { }; }; + connector-repos = mapAttrs make-priv-repo { + autosync = { }; + }; + # TODO move users to separate module make-priv-repo = name: { desc ? null, ... }: { @@ -40,29 +46,34 @@ let }; }; - set-owners = with git;repo: user: - singleton { - inherit user; - repo = [ repo ]; - perm = push "refs/*" [ non-fast-forward create delete merge ]; - }; - set-ro-access = with git; repo: user: - optional repo.public { - inherit user; - repo = [ repo ]; - perm = fetch; - }; # TODO: get the list of all krebsministers krebsminister = with config.krebs.users; [ lass tv uriel ]; all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ]; + exco = with config.krebs.users; [ exco ]; priv-rules = repo: set-owners repo all-makefu; + connector-rules = repo: set-owners repo (all-makefu ++ exco); + krebs-rules = repo: set-owners repo all-makefu ++ set-ro-access repo krebsminister; + set-ro-access = with git; repo: user: + optional repo.public { + inherit user; + repo = [ repo ]; + perm = fetch; + }; + + set-owners = with git;repo: user: + singleton { + inherit user; + repo = [ repo ]; + perm = push "refs/*" [ non-fast-forward create delete merge ]; + }; + in { imports = [{ krebs.users.makefu-omo = { @@ -73,6 +84,11 @@ in { name = "makefu-tsp" ; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub; }; + + krebs.users.exco = { + name = "exco" ; + pubkey= with builtins; readFile ../../../krebs/Zpubkeys/exco.ssh.pub; + }; }]; krebs.git = { enable = true; -- cgit v1.2.3 From b2ac9b092a36c3196469099c73c64c8ca6626be0 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 17 Nov 2015 22:16:55 +0100 Subject: makefu: fix cgit for wry, add gc to wry --- makefu/2configs/git/cgit-retiolum.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 748cd6427..e12827697 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -22,7 +22,7 @@ let }; connector-repos = mapAttrs make-priv-repo { - autosync = { }; + connector = { }; }; @@ -36,7 +36,7 @@ let inherit name desc; public = true; hooks = { - post-receive = git.irc-announce { + post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; verbose = config.krebs.build.host.name == "pnp"; channel = "#retiolum"; @@ -51,11 +51,11 @@ let # TODO: get the list of all krebsministers krebsminister = with config.krebs.users; [ lass tv uriel ]; all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ]; - exco = with config.krebs.users; [ exco ]; + all-exco = with config.krebs.users; [ exco ]; priv-rules = repo: set-owners repo all-makefu; - connector-rules = repo: set-owners repo (all-makefu ++ exco); + connector-rules = repo: set-owners repo all-makefu ++ set-owners repo all-exco; krebs-rules = repo: set-owners repo all-makefu ++ set-ro-access repo krebsminister; @@ -76,18 +76,19 @@ let in { imports = [{ - krebs.users.makefu-omo = { + krebs.users = { + makefu-omo = { name = "makefu-omo" ; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_omo.ssh.pub; - }; - krebs.users.makefu-tsp = { + }; + makefu-tsp = { name = "makefu-tsp" ; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub; - }; - - krebs.users.exco = { - name = "exco" ; + }; + exco = { + name = "exco"; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/exco.ssh.pub; + }; }; }]; krebs.git = { -- cgit v1.2.3 From c7bb244bdf40cbcac76c23cda58e745021fa7247 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 27 Nov 2015 23:10:44 +0100 Subject: m 1 gum: provides mattermost via docker container --- makefu/2configs/mattermost-docker.nix | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 makefu/2configs/mattermost-docker.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/mattermost-docker.nix b/makefu/2configs/mattermost-docker.nix new file mode 100644 index 000000000..20a93dff1 --- /dev/null +++ b/makefu/2configs/mattermost-docker.nix @@ -0,0 +1,47 @@ +{config, lib, ...}: + +with lib; +let + sec = toString ; + ssl_cert = "${sec}/wildcard.krebsco.de.crt"; + ssl_key = "${sec}/wildcard.krebsco.de.key"; +in { + # mattermost docker config and deployment guide: git.euer.krebsco.de + virtualisation.docker.enable = true; + users.extraUsers.${config.krebs.build.user.name}.extraGroups = [ "docker" ]; + krebs.nginx = { + enable = true; + servers.mattermost = { + listen = [ "80" "443 ssl" ]; + server-names = [ "mattermost.euer.krebsco.de" ]; + extraConfig = '' + gzip on; + gzip_buffers 4 32k; + gzip_types text/plain application/x-javascript text/css; + ssl_certificate ${ssl_cert}; + ssl_certificate_key ${ssl_key}; + default_type text/plain; + + if ($scheme = http){ + return 301 https://$server_name$request_uri; + } + + client_max_body_size 4G; + keepalive_timeout 10; + + ''; + locations = [ + (nameValuePair "/" '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_redirect off; + proxy_pass http://localhost:8065/; + '') + ]; + }; + }; +} -- cgit v1.2.3 From 61d9ec179b3d1a55602a1ae188e70c84e5721107 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 Dec 2015 20:36:09 +0100 Subject: m 2 git: add mattermost --- makefu/2configs/git/cgit-retiolum.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index e12827697..304d39fcd 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -15,6 +15,7 @@ let tinc_graphs = { desc = "Tinc Advanced Graph Generation"; }; + cac = { }; }; priv-repos = mapAttrs make-priv-repo { @@ -23,6 +24,9 @@ let connector-repos = mapAttrs make-priv-repo { connector = { }; + mattermost = { + desc = "Mattermost Docker files"; + }; }; -- cgit v1.2.3 From ada1aa277ce40df309e7440905e94a0b11d6e163 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 Dec 2015 20:36:42 +0100 Subject: m 2 default: do not restart ssh agent --- makefu/2configs/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 3d9174788..760c70789 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -65,6 +65,7 @@ with lib; time.timeZone = "Europe/Berlin"; #nix.maxJobs = 1; + programs.ssh.startAgent = false; services.openssh.enable = true; nix.useChroot = true; -- cgit v1.2.3 From b5ffb88ba3a77d4f399d7a2815e2c61d53545f5d Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 Dec 2015 20:37:04 +0100 Subject: m 2 base-gui: add TODO --- makefu/2configs/base-gui.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/base-gui.nix b/makefu/2configs/base-gui.nix index 7b7f85f13..16a5386ca 100644 --- a/makefu/2configs/base-gui.nix +++ b/makefu/2configs/base-gui.nix @@ -10,6 +10,17 @@ # # if this is not enough, check out main-laptop.nix +## TODO: .Xdefaults: +# URxvt*termName: rxvt +# URxvt.scrollBar : false +# URxvt*scrollBar_right: false +# URxvt*borderLess: false +# URxvt.foreground: white +# URxvt.background: black +# URxvt.urgentOnBell: true +# URxvt.visualBell: false +# URxvt.font : xft:Terminus + with lib; let mainUser = config.krebs.build.user.name; -- cgit v1.2.3 From a2461b2a8216ee49ca260d54fb91596ecf5cd45d Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 4 Dec 2015 22:42:44 +0100 Subject: m 1 pornocauster: add printing,virtualbox --- makefu/2configs/printer.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 makefu/2configs/printer.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix new file mode 100644 index 000000000..35ad54bd9 --- /dev/null +++ b/makefu/2configs/printer.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + services.printing = { + enable = true; + drivers = [ + pkgs.samsungUnifiedLinuxDriver + ]; + }; +} -- cgit v1.2.3 From d83489feb1005dae7161909fcd0bf81a37e1ca41 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 8 Dec 2015 18:05:46 +0100 Subject: m 2 Reaktor: init of sed-plugin --- makefu/2configs/Reaktor/sed-plugin.py | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 makefu/2configs/Reaktor/sed-plugin.py (limited to 'makefu/2configs') diff --git a/makefu/2configs/Reaktor/sed-plugin.py b/makefu/2configs/Reaktor/sed-plugin.py new file mode 100644 index 000000000..6d6e1f8b8 --- /dev/null +++ b/makefu/2configs/Reaktor/sed-plugin.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +# Usage: +# _from=krebs statedir=. python sed-plugin.py 'dick butt' +# _from=krebs statedir=. python sed-plugin.py 's/t/l/g' +## dick bull +import shelve +from os import environ +from os.path import join +from sys import argv +d = shelve.open(join(environ['statedir'],'sed-plugin.shelve'),writeback=True) +import re + +def is_regex(line): + # TODO: match s/di\/ck/butt/ but not s/di/ck/butt/ + myre = re.compile(r'^s/((?:\\/|[^/])+)/((?:\\/|[^/])*)/([ig]*)$') + return myre.match(line) + +line = argv[1] +m = is_regex(line) + +if m: + f,t,flagstr = m.groups() + f = f.replace('\/','/') + t = t.replace('\/','/') + flags = 0 + count = 1 + if flagstr: + if 'i' in flagstr: + flags = re.IGNORECASE + if 'g' in flagstr: + count = 0 + last = d.get(environ['_from'],None) + if last: + print(f,t,last) + print(re.sub(f,t,last,count=count,flags=flags)) + else: + print("no last message") +else: + print("setting line") + d[environ['_from']] = line + +d.close() -- cgit v1.2.3 From 869a278aa8bdaf981222a4e72a4cfc3fbb740f95 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 8 Dec 2015 18:26:08 +0100 Subject: m 2 Reaktor: use sed-plugin --- makefu/2configs/Reaktor/sed-plugin.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/Reaktor/sed-plugin.py b/makefu/2configs/Reaktor/sed-plugin.py index 6d6e1f8b8..677a1a44f 100644 --- a/makefu/2configs/Reaktor/sed-plugin.py +++ b/makefu/2configs/Reaktor/sed-plugin.py @@ -21,8 +21,8 @@ m = is_regex(line) if m: f,t,flagstr = m.groups() - f = f.replace('\/','/') - t = t.replace('\/','/') + fn = f.replace('\/','/') + tn = t.replace('\/','/') flags = 0 count = 1 if flagstr: @@ -30,10 +30,20 @@ if m: flags = re.IGNORECASE if 'g' in flagstr: count = 0 + else: + flagstr = '' last = d.get(environ['_from'],None) if last: - print(f,t,last) - print(re.sub(f,t,last,count=count,flags=flags)) + print(fn,tn,last) + #print(re.sub(fn,tn,last,count=count,flags=flags)) + from subprocess import Popen,PIPE + p = Popen(['sed','s/{}/{}/{}'.format(f,t,flagstr)],stdin=PIPE,stdout=PIPE ) + so,_ = p.communicate(last+"\n") + if p.returncode: + print("something went wrong when trying to process your regex") + print(so) + + else: print("no last message") else: -- cgit v1.2.3 From ee4546c9a4de6886f370f7ef59f327ef5f2251b1 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 8 Dec 2015 19:38:19 +0100 Subject: m 2 Reaktor: finish sed-plugin --- makefu/2configs/Reaktor/sed-plugin.nix | 18 ++++++++++++++++++ makefu/2configs/Reaktor/sed-plugin.py | 24 ++++++++++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 makefu/2configs/Reaktor/sed-plugin.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/Reaktor/sed-plugin.nix b/makefu/2configs/Reaktor/sed-plugin.nix new file mode 100644 index 000000000..1ec977116 --- /dev/null +++ b/makefu/2configs/Reaktor/sed-plugin.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +with pkgs; +let + script = ./sed-plugin.py; +in { + #TODO: this will eat up the last regex, fix Reaktor + krebs.Reaktor.extraConfig = '' + public_commands.append({ + 'capname' : "shack-correct", + # only support s///gi + 'pattern' : '^(?P.*)$$', + 'argv' : ["${pkgs.python3}/bin/python3","${script}"], + 'env' : { 'state_dir' : workdir, + 'PATH':'${lib.makeSearchPath "bin" [pkgs.gnused]}' }}) + ''; +} + diff --git a/makefu/2configs/Reaktor/sed-plugin.py b/makefu/2configs/Reaktor/sed-plugin.py index 677a1a44f..8103c9585 100644 --- a/makefu/2configs/Reaktor/sed-plugin.py +++ b/makefu/2configs/Reaktor/sed-plugin.py @@ -1,18 +1,18 @@ #!/usr/bin/env python3 # Usage: -# _from=krebs statedir=. python sed-plugin.py 'dick butt' -# _from=krebs statedir=. python sed-plugin.py 's/t/l/g' +# _from=krebs state_dir=. python sed-plugin.py 'dick butt' +# _from=krebs state_dir=. python sed-plugin.py 's/t/l/g' ## dick bull import shelve from os import environ from os.path import join from sys import argv -d = shelve.open(join(environ['statedir'],'sed-plugin.shelve'),writeback=True) +d = shelve.open(join(environ['state_dir'],'sed-plugin.shelve'),writeback=True) +usr = environ['_from'] import re def is_regex(line): - # TODO: match s/di\/ck/butt/ but not s/di/ck/butt/ myre = re.compile(r'^s/((?:\\/|[^/])+)/((?:\\/|[^/])*)/([ig]*)$') return myre.match(line) @@ -32,22 +32,22 @@ if m: count = 0 else: flagstr = '' - last = d.get(environ['_from'],None) + last = d.get(usr,None) if last: - print(fn,tn,last) #print(re.sub(fn,tn,last,count=count,flags=flags)) from subprocess import Popen,PIPE p = Popen(['sed','s/{}/{}/{}'.format(f,t,flagstr)],stdin=PIPE,stdout=PIPE ) - so,_ = p.communicate(last+"\n") + so,se = p.communicate(bytes("{}\n".format(last),"UTF-8")) if p.returncode: - print("something went wrong when trying to process your regex") - print(so) - + print("something went wrong when trying to process your regex: {}".format(se.decode())) + ret = so.decode() + print("\x1b[1m{}\x1b[0m meinte: {}".format(usr,ret.strip())) + if ret: + d[usr] = ret else: print("no last message") else: - print("setting line") - d[environ['_from']] = line + d[usr] = line d.close() -- cgit v1.2.3 From 6a07012a2f2ab8673c464256bd46efedf95366c3 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 13 Dec 2015 13:52:15 +0100 Subject: m 2 fetchWallpaper: default enabled for mainlaptop --- makefu/2configs/fetchWallpaper.nix | 24 ++++++++++++++++++++++++ makefu/2configs/main-laptop.nix | 5 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/fetchWallpaper.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/fetchWallpaper.nix b/makefu/2configs/fetchWallpaper.nix new file mode 100644 index 000000000..b071a128d --- /dev/null +++ b/makefu/2configs/fetchWallpaper.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: + +let + # check if laptop runs on umts + weaksauce-internet = with pkgs;writeScript "weaksauce-internet" '' + #! /bin/sh + if ${iproute}/bin/ip addr show dev ppp0 2>/dev/null \ + | ${gnugrep}/bin/grep -q inet;then + exit 1 + fi + ''; + +in { + krebs.fetchWallpaper = { + enable = true; + display = ":0"; + predicate = weaksauce-internet; + timerConfig = { + OnCalendar = "*:0/30"; + }; + url = "http://echelon/wallpaper.png"; + }; +} + diff --git a/makefu/2configs/main-laptop.nix b/makefu/2configs/main-laptop.nix index dfc8c1c07..00a3e73ca 100644 --- a/makefu/2configs/main-laptop.nix +++ b/makefu/2configs/main-laptop.nix @@ -6,7 +6,10 @@ with lib; { - imports = [ ./base-gui.nix ]; + imports = [ + ./base-gui.nix + ./fetchWallpaper.nix + ]; environment.systemPackages = with pkgs;[ vlc firefox -- cgit v1.2.3 From 809ffa435c4ba759a6cfd7fdffc976499d470d82 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 13 Dec 2015 14:35:30 +0100 Subject: m 2 default: use timesyncd instead of ntpd --- makefu/2configs/default.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 760c70789..519635281 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -80,7 +80,14 @@ with lib; "d /tmp 1777 root root - -" ]; - environment.variables.EDITOR = mkForce "vim"; + environment.variables = { + NIX_PATH = with config.krebs.build.source; with dir; with git; + mkForce (concatStringsSep ":" [ + "nixpkgs=${nixpkgs.target-path}" + "${nixpkgs.target-path}" + ]); + EDITOR = mkForce "vim"; + }; environment.systemPackages = with pkgs; [ jq @@ -124,6 +131,14 @@ with lib; services.cron.enable = false; services.nscd.enable = false; + services.ntp.enable = false; + services.timesyncd.enable = true; + services.ntp.servers = [ + "pool.ntp.org" + "time.windows.com" + "time.apple.com" + "time.nist.gov" + ]; security.setuidPrograms = [ "sendmail" ]; services.journald.extraConfig = '' -- cgit v1.2.3 From c3bd222b9f8c4b7d08a447760ae5ae28b90f217e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Dec 2015 14:17:21 +0100 Subject: m 2 tinc: add ire as potential supernode --- makefu/2configs/tinc-basic-retiolum.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/tinc-basic-retiolum.nix b/makefu/2configs/tinc-basic-retiolum.nix index fd6d1683d..2abf4f188 100644 --- a/makefu/2configs/tinc-basic-retiolum.nix +++ b/makefu/2configs/tinc-basic-retiolum.nix @@ -9,6 +9,7 @@ with lib; "gum" "pigstarter" "fastpoke" + "ire" ]; }; } -- cgit v1.2.3 From 83208910bbedc70018c5a7f0e4b18baed418f9cf Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Dec 2015 14:32:20 +0100 Subject: m 2 git: add vbob pubkey --- makefu/2configs/git/cgit-retiolum.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 304d39fcd..5143ca5aa 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -24,6 +24,7 @@ let connector-repos = mapAttrs make-priv-repo { connector = { }; + minikrebs = { }; mattermost = { desc = "Mattermost Docker files"; }; @@ -54,7 +55,7 @@ let # TODO: get the list of all krebsministers krebsminister = with config.krebs.users; [ lass tv uriel ]; - all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp ]; + all-makefu = with config.krebs.users; [ makefu makefu-omo makefu-tsp makefu-vbob ]; all-exco = with config.krebs.users; [ exco ]; priv-rules = repo: set-owners repo all-makefu; @@ -85,6 +86,10 @@ in { name = "makefu-omo" ; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_omo.ssh.pub; }; + makefu-vbob = { + name = "makefu-vbob" ; + pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_vbob.ssh.pub; + }; makefu-tsp = { name = "makefu-tsp" ; pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub; -- cgit v1.2.3 From 9900811f941abf5e31f3c7b616e3fa27f88ffb35 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Dec 2015 14:36:36 +0100 Subject: m 2 git: use gum as primary git host --- makefu/2configs/git/cgit-retiolum.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 5143ca5aa..68fd976d6 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -43,7 +43,7 @@ let hooks = { post-receive = pkgs.git-hooks.irc-announce { nick = config.networking.hostName; - verbose = config.krebs.build.host.name == "pnp"; + verbose = config.krebs.build.host.name == "gum"; channel = "#retiolum"; # TODO remove the hardcoded hostname server = "cd.retiolum"; -- cgit v1.2.3 From 9bc0c474ace8e1bcccb5301a1726ed75a6241bff Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Dec 2015 17:12:51 +0100 Subject: m 2 Reaktor: add full profile --- makefu/2configs/Reaktor/full.nix | 18 ++++++++++++++++++ makefu/2configs/git/cgit-retiolum.nix | 20 -------------------- 2 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 makefu/2configs/Reaktor/full.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/Reaktor/full.nix b/makefu/2configs/Reaktor/full.nix new file mode 100644 index 000000000..50620890f --- /dev/null +++ b/makefu/2configs/Reaktor/full.nix @@ -0,0 +1,18 @@ +_: +{ + # implementation of the complete Reaktor bot + imports = [ + #./stockholmLentil.nix + ./simpleExtend.nix + ./random-emoji.nix + ./titlebot.nix + ./shack-correct.nix + ./sed-plugin.nix + ]; + krebs.Reaktor.nickname = "Reaktor|bot"; + krebs.Reaktor.enable = true; + + krebs.Reaktor.extraEnviron = { + REAKTOR_CHANNELS = "#krebs,#binaergewitter,#shackspace"; + }; +} diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 68fd976d6..35bb169cf 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -80,26 +80,6 @@ let }; in { - imports = [{ - krebs.users = { - makefu-omo = { - name = "makefu-omo" ; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_omo.ssh.pub; - }; - makefu-vbob = { - name = "makefu-vbob" ; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_vbob.ssh.pub; - }; - makefu-tsp = { - name = "makefu-tsp" ; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub; - }; - exco = { - name = "exco"; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/exco.ssh.pub; - }; - }; - }]; krebs.git = { enable = true; root-title = "public repositories"; -- cgit v1.2.3 From 55ad05879b8ba97e369bfd72810028dd4622e356 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 14 Dec 2015 19:36:06 +0100 Subject: s 1 wolf: initial preparation of ci packaging --- makefu/2configs/nginx/euer.test.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 makefu/2configs/nginx/euer.test.nix (limited to 'makefu/2configs') diff --git a/makefu/2configs/nginx/euer.test.nix b/makefu/2configs/nginx/euer.test.nix new file mode 100644 index 000000000..ffdc0bc60 --- /dev/null +++ b/makefu/2configs/nginx/euer.test.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + hostname = config.krebs.build.host.name; + user = config.services.nginx.user; + group = config.services.nginx.group; + external-ip = head config.krebs.build.host.nets.internet.addrs4; + internal-ip = head config.krebs.build.host.nets.retiolum.addrs4; +in { + krebs.nginx = { + enable = mkDefault true; + servers = { + euer-share = { + listen = [ ]; + server-names = [ "share.euer.krebsco.de" ]; + locations = singleton (nameValuePair "/" '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://localhost:8000/; + ''); + }; + }; + }; +} -- cgit v1.2.3 From d4792eb7231acf5bf66409adb4e777433998678b Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 15 Dec 2015 15:33:34 +0100 Subject: prepare zshrc, makes ~/.zshrc obsolete --- makefu/2configs/zsh-user.nix | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 3089b706a..266ce256a 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -5,6 +5,36 @@ let mainUser = config.krebs.build.user.name; in { - programs.zsh.enable = true; users.extraUsers.${mainUser}.shell = "/run/current-system/sw/bin/zsh"; + programs.zsh= { + enable = true; + interactiveShellInit = '' + HISTSIZE=900001 + HISTFILESIZE=$HISTSIZE + SAVEHIST=$HISTSIZE + + setopt HIST_IGNORE_ALL_DUPS + setopt HIST_IGNORE_SPACE + setopt HIST_FIND_NO_DUPS + bindkey -e + # shift-tab + bindkey '^[[Z' reverse-menu-complete + + autoload -U compinit && compinit + zstyle ':completion:*' menu select + ''; + + promptInit = '' + RPROMPT="" + autoload colors && colors + case $UID in + 0) PROMPT="%{$fg[red]%}%~%{$reset_color%} " ;; + 9001) PROMPT="%{$fg[green]%}%~%{$reset_color%} " ;; + *) PROMPT="%{$fg[yellow]%}%n %{$fg[green]%}%~%{$reset_color%} " ;; + esac + if test -n "$SSH_CLIENT"; then + PROMPT="%{$fg[magenta]%}%m $PROMPT" + fi + ''; + }; } -- cgit v1.2.3 From 09f4611f38ecaf471a54c09fc3fa9350ffe3f0b9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 10:42:40 +0100 Subject: m 2 default: add aliases, pythonstartup env --- makefu/2configs/default.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 519635281..c0d7685e3 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -104,6 +104,8 @@ with lib; HISTSIZE=900001 HISTFILESIZE=$HISTSIZE + PYTHONSTARTUP="~/.pythonrc"; + shopt -s checkhash shopt -s histappend histreedit histverify shopt -s no_empty_cmd_completion @@ -123,6 +125,9 @@ with lib; environment.shellAliases = { lsl = "ls -lAtr"; + psg = "ps -ef | grep"; + nmap = "nmap -oN $HOME/loot/scan-`date +\%s`.nmap -oX $HOME/loot/scan-`date +%s`.xml"; + grep = "grep --color=auto"; }; nixpkgs.config.packageOverrides = pkgs: { -- cgit v1.2.3 From c20d38e11ecf38dda8931769a04cdcdf96f88c3f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 11:40:18 +0100 Subject: m 2 base-gui: write xdefaults, obsoletes ~/.Xdefaults --- makefu/2configs/base-gui.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/base-gui.nix b/makefu/2configs/base-gui.nix index 16a5386ca..1d6750284 100644 --- a/makefu/2configs/base-gui.nix +++ b/makefu/2configs/base-gui.nix @@ -73,4 +73,33 @@ in enable = true; # systemWide = true; }; + services.xserver.displayManager.sessionCommands = let + xdefaultsfile = pkgs.writeText "Xdefaults" '' + cat |derp < Date: Wed, 16 Dec 2015 11:40:48 +0100 Subject: m 2 zsh-user: load gpg-agent, obsoletes oh-my-zsh ssh plugin --- makefu/2configs/zsh-user.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 266ce256a..1b1762418 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -22,6 +22,16 @@ in autoload -U compinit && compinit zstyle ':completion:*' menu select + + # load gpg-agent + envfile="$HOME/.gnupg/gpg-agent.env" + if [ -e "$envfile" ] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then + eval "$(cat "$envfile")" + else + eval "$(${pkgs.gnupg}/bin/gpg-agent --daemon --enable-ssh-support --write-env-file "$envfile")" + fi + export GPG_AGENT_INFO + export SSH_AUTH_SOCK ''; promptInit = '' -- cgit v1.2.3 From 27746f9a3dffe6adde137d300e498249843174d9 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 11:43:56 +0100 Subject: m 2 wwan: add alias for umts when wwan is loaded --- makefu/2configs/wwan.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/wwan.nix b/makefu/2configs/wwan.nix index dd1c63090..29a610ac6 100644 --- a/makefu/2configs/wwan.nix +++ b/makefu/2configs/wwan.nix @@ -9,6 +9,10 @@ in { wvdial ]; + environment.shellAliases = { + umts = "sudo wvdial netzclub"; + }; + # configure for NETZCLUB environment.wvdial.dialerDefaults = '' Phone = *99***1# -- cgit v1.2.3 From 5af1d1c7b14c08ba1c0198cc9771c452218670b0 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 11:54:58 +0100 Subject: m 2 Reaktor: sed-plugin fix name --- makefu/2configs/Reaktor/sed-plugin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/Reaktor/sed-plugin.nix b/makefu/2configs/Reaktor/sed-plugin.nix index 1ec977116..a451e0d3e 100644 --- a/makefu/2configs/Reaktor/sed-plugin.nix +++ b/makefu/2configs/Reaktor/sed-plugin.nix @@ -7,7 +7,7 @@ in { #TODO: this will eat up the last regex, fix Reaktor krebs.Reaktor.extraConfig = '' public_commands.append({ - 'capname' : "shack-correct", + 'capname' : "sed-plugin", # only support s///gi 'pattern' : '^(?P.*)$$', 'argv' : ["${pkgs.python3}/bin/python3","${script}"], -- cgit v1.2.3 From a4abf300d8adea5a454f8664f2de6dd8e9095216 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2015 12:29:24 +0100 Subject: m 2 main-laptop: use zsh for main-laptop --- makefu/2configs/main-laptop.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs') diff --git a/makefu/2configs/main-laptop.nix b/makefu/2configs/main-laptop.nix index 00a3e73ca..b725f661d 100644 --- a/makefu/2configs/main-laptop.nix +++ b/makefu/2configs/main-laptop.nix @@ -9,6 +9,7 @@ with lib; imports = [ ./base-gui.nix ./fetchWallpaper.nix + ./zsh-user.nix ]; environment.systemPackages = with pkgs;[ vlc -- cgit v1.2.3 From 3f4bd94233164a9b12d61c1a460b6eff83c39209 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 17 Dec 2015 17:38:33 +0100 Subject: m 2 git/brain-retiolum: remove obsolete users --- makefu/2configs/git/brain-retiolum.nix | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'makefu/2configs') diff --git a/makefu/2configs/git/brain-retiolum.nix b/makefu/2configs/git/brain-retiolum.nix index 066d50a28..25ef584bf 100644 --- a/makefu/2configs/git/brain-retiolum.nix +++ b/makefu/2configs/git/brain-retiolum.nix @@ -59,16 +59,7 @@ let set-owners repo all-makefu ++ set-ro-access repo krebsminister; in { - imports = [{ - krebs.users.makefu-omo = { - name = "makefu-omo" ; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_omo.ssh.pub; - }; - krebs.users.makefu-tsp = { - name = "makefu-tsp" ; - pubkey= with builtins; readFile ../../../krebs/Zpubkeys/makefu_tsp.ssh.pub; - }; - }]; + imports = [ ]; krebs.git = { enable = true; cgit = false; -- cgit v1.2.3