summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml14
-rw-r--r--krebs/2configs/shack/gitlab-runner.nix2
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix2
-rw-r--r--krebs/2configs/shack/share.nix4
-rw-r--r--krebs/3modules/default.nix12
-rw-r--r--krebs/3modules/dns.nix2
-rw-r--r--krebs/3modules/hosts.nix6
-rw-r--r--krebs/3modules/tv/default.nix37
-rw-r--r--makefu/0tests/data/secrets/bureautomation/citadel.nix4
-rw-r--r--makefu/2configs/bureautomation/camera/comic.nix4
-rw-r--r--makefu/2configs/bureautomation/comic-updater.nix12
-rw-r--r--makefu/2configs/bureautomation/default.nix7
-rw-r--r--makefu/2configs/git/cgit-retiolum.nix1
-rw-r--r--makefu/2configs/tools/consoles.nix2
-rw-r--r--makefu/2configs/tools/media.nix1
-rw-r--r--makefu/5pkgs/hactool/default.nix30
-rw-r--r--makefu/5pkgs/nx_game_info/default.nix32
-rw-r--r--tv/2configs/binary-cache/default.nix2
-rw-r--r--tv/2configs/default.nix1
-rw-r--r--tv/2configs/nets/hkw.nix69
-rw-r--r--tv/2configs/nginx/public_html.nix2
21 files changed, 194 insertions, 52 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4a7a4e60..76a304af 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,8 +10,12 @@ before_script:
- chmod 600 ~/.ssh/gitlab_deploy.key
- echo "$ssh_git_shackspace_serverkey" >> ~/.ssh/known_hosts
# import secret key for secrets
+ - which gpg
+ - which gpg2
- echo "$secrets_gpg_key" | gpg --import
deployment test:
+ tags:
+ - nix
stage: test
script:
- GIT_SSH_COMMAND="ssh -i ~/.ssh/gitlab_deploy.key" git clone git@ssh.git.shackspace.de:rz/secrets.git ~/brain
@@ -21,6 +25,8 @@ deployment test:
- $(nix-build krebs/krops.nix --no-out-link --argstr name puyak --argstr target /tmp -A test)
nix-shell test:
stage: test
+ tags:
+ - nix
script:
- nix-shell --pure --command 'true' -p stdenv && echo success
- nix-shell --pure --command 'false' -p stdenv || echo success
@@ -29,6 +35,9 @@ nix-shell test:
- gpg --version
- curl --version
wolf deployment:
+ tags:
+ - shacklan
+ - nix
stage: deploy
script:
- cp ~/.ssh/gitlab_deploy.key ~/.ssh/id_rsa
@@ -44,6 +53,9 @@ wolf deployment:
- .gitmodules
puyak deployment:
stage: deploy
+ tags:
+ - shacklan
+ - nix
script:
- cp ~/.ssh/gitlab_deploy.key ~/.ssh/id_rsa
- git clone git@ssh.git.shackspace.de:rz/secrets.git ~/brain
@@ -58,6 +70,8 @@ puyak deployment:
- .gitmodules
nur-packages makefu:
stage: deploy
+ tags:
+ - nix
script:
- git reset --hard origin/master
- git filter-branch -f --prune-empty --subdirectory-filter makefu/5pkgs HEAD
diff --git a/krebs/2configs/shack/gitlab-runner.nix b/krebs/2configs/shack/gitlab-runner.nix
index 5f2ca02d..bd391851 100644
--- a/krebs/2configs/shack/gitlab-runner.nix
+++ b/krebs/2configs/shack/gitlab-runner.nix
@@ -14,6 +14,8 @@ in
## registrationConfigurationFile contains:
# CI_SERVER_URL=<CI server URL>
# REGISTRATION_TOKEN=<registration secret>
+ # RUNNER_TAG_LIST=nix,shacklan
+ # RUNNER_NAME=stockholm-runner-$name
registrationConfigFile = <secrets/shackspace-gitlab-ci>;
#gracefulTermination = true;
};
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix
index 0a7ffc41..6f3dc98a 100644
--- a/krebs/2configs/shack/glados/multi/wasser.nix
+++ b/krebs/2configs/shack/glados/multi/wasser.nix
@@ -2,7 +2,7 @@
# switch.crafting_giesskanne_relay
let
glados = import ../lib;
- seconds = 5;
+ seconds = 10;
wasser = "switch.crafting_giesskanne_relay";
in
{
diff --git a/krebs/2configs/shack/share.nix b/krebs/2configs/shack/share.nix
index 247b9ee7..465d6ef6 100644
--- a/krebs/2configs/shack/share.nix
+++ b/krebs/2configs/shack/share.nix
@@ -33,6 +33,10 @@
printing = bsd
printcap name = /dev/null
disable spoolss = yes
+
+ # for legacy systems
+ client min protocol = NT1
+ server min protocol = NT1
'';
};
}
diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index 2772bf98..bd6bab37 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -109,7 +109,6 @@ let
{
krebs.dns.providers = {
"krebsco.de" = "zones";
- gg23 = "hosts";
shack = "hosts";
i = "hosts";
r = "hosts";
@@ -153,9 +152,11 @@ let
let
longs = net.aliases;
shorts =
- map (removeSuffix ".${cfg.dns.search-domain}")
- (filter (hasSuffix ".${cfg.dns.search-domain}")
- longs);
+ optionals
+ (cfg.dns.search-domain != null)
+ (map (removeSuffix ".${cfg.dns.search-domain}")
+ (filter (hasSuffix ".${cfg.dns.search-domain}")
+ longs));
add-port = a:
if net.ssh.port != 22
then "[${a}]:${toString net.ssh.port}"
@@ -178,7 +179,8 @@ let
(concatMap (host: attrValues host.nets)
(mapAttrsToList
(_: host: recursiveUpdate host
- (optionalAttrs (hasAttr cfg.dns.search-domain host.nets) {
+ (optionalAttrs (cfg.dns.search-domain != null &&
+ hasAttr cfg.dns.search-domain host.nets) {
nets."" = host.nets.${cfg.dns.search-domain} // {
aliases = [host.name];
addrs = [];
diff --git a/krebs/3modules/dns.nix b/krebs/3modules/dns.nix
index b7e2a2cb..8acc4ccd 100644
--- a/krebs/3modules/dns.nix
+++ b/krebs/3modules/dns.nix
@@ -6,7 +6,7 @@ with import <stockholm/lib>;
};
krebs.dns.search-domain = mkOption {
- type = types.hostname;
+ type = types.nullOr types.hostname;
};
};
}
diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix
index 7fe01a76..159b54e3 100644
--- a/krebs/3modules/hosts.nix
+++ b/krebs/3modules/hosts.nix
@@ -24,7 +24,11 @@ in {
aliases = longs ++ shorts;
longs = filter check net.aliases;
shorts = let s = ".${config.krebs.dns.search-domain}"; in
- map (removeSuffix s) (filter (hasSuffix s) longs);
+ optionals
+ (config.krebs.dns.search-domain != null)
+ (map (removeSuffix s)
+ (filter (hasSuffix s)
+ longs));
in
map (addr: { ${addr} = aliases; }) net.addrs)
(attrValues host.nets))
diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix
index a20801b1..c2bf406f 100644
--- a/krebs/3modules/tv/default.nix
+++ b/krebs/3modules/tv/default.nix
@@ -131,11 +131,6 @@ in {
ci = true;
cores = 2;
nets = {
- gg23 = {
- ip4.addr = "10.23.1.110";
- aliases = ["nomic.gg23"];
- ssh.port = 11423;
- };
retiolum = {
ip4.addr = "10.243.0.110";
aliases = [
@@ -158,27 +153,10 @@ in {
ssh.privkey.path = <secrets/ssh.id_ed25519>;
ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMIHmwXHV7E9UGuk4voVCADjlLkyygqNw054jvrsPn5t root@nomic";
};
- ok = {
- external = true;
- nets = {
- gg23 = {
- ip4.addr = "10.23.1.1";
- aliases = ["ok.gg23"];
- };
- };
- };
wu = {
ci = true;
cores = 4;
nets = {
- gg23 = {
- ip4.addr = "10.23.1.37";
- aliases = [
- "wu.gg23"
- "cache.wu.gg23"
- ];
- ssh.port = 11423;
- };
retiolum = {
ip4.addr = "10.243.13.37";
aliases = [
@@ -237,14 +215,6 @@ in {
ci = true;
cores = 4;
nets = {
- gg23 = {
- ip4.addr = "10.23.1.38";
- aliases = [
- "xu.gg23"
- "cache.xu.gg23"
- ];
- ssh.port = 11423;
- };
retiolum = {
ip4.addr = "10.243.13.38";
aliases = [
@@ -272,13 +242,6 @@ in {
ci = true;
cores = 4;
nets = {
- gg23 = {
- ip4.addr = "10.23.1.39";
- aliases = [
- "zu.gg23"
- ];
- ssh.port = 11423;
- };
retiolum = {
ip4.addr = "10.243.13.40";
aliases = [
diff --git a/makefu/0tests/data/secrets/bureautomation/citadel.nix b/makefu/0tests/data/secrets/bureautomation/citadel.nix
new file mode 100644
index 00000000..b4433109
--- /dev/null
+++ b/makefu/0tests/data/secrets/bureautomation/citadel.nix
@@ -0,0 +1,4 @@
+{
+ MATRIX_TOKEN="a";
+ MATRIX_ID="b";
+}
diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix
index a847b0ad..a523d032 100644
--- a/makefu/2configs/bureautomation/camera/comic.nix
+++ b/makefu/2configs/bureautomation/camera/comic.nix
@@ -3,4 +3,8 @@
platform = "generic";
still_image_url = http://127.0.0.1:8123/local/lines.png ;
}
+ { name = "XKCD";
+ platform = "generic";
+ still_image_url = http://127.0.0.1:8123/local/xkcd.png ;
+ }
]
diff --git a/makefu/2configs/bureautomation/comic-updater.nix b/makefu/2configs/bureautomation/comic-updater.nix
index 5f26bc2c..1e244093 100644
--- a/makefu/2configs/bureautomation/comic-updater.nix
+++ b/makefu/2configs/bureautomation/comic-updater.nix
@@ -6,21 +6,29 @@ let
in {
systemd.services.comic-updater = {
startAt = "daily";
- description = "Send led change to message queue";
+ description = "update our comics";
after = [ "network-online.target" ] ++ (lib.optional config.services.mosquitto.enable "mosquitto.service");
path = with pkgs; [ wget xmlstarlet ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "hass";
WorkingDirectory = config.services.home-assistant.configDir;
- ExecStart = pkgs.writeDash "update-poorly-drawn-lines" ''
+ ExecStart = pkgs.writeDash "update-comics" ''
set -euf
mkdir -p www/
cd www/
+ # poorly drawn lines
pic=$(wget -O- http://www.poorlydrawnlines.com/feed/ \
| xml sel -t -v '/rss/channel/item/content:encoded' \
| head -n 2 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
wget "$pic" -nc && cp -v "$(basename "$pic")" lines.png
+
+ #pic=$(curl -L xkcd.com 2>/dev/null | grep imgs.xkcd.com | grep title | sed -n 's/.*src="\([^"]\+\)" .*/https:\1/p')
+ # xkcd
+ pic=$(wget -O- https://xkcd.com/rss.xml \
+ | xml sel -t -v '/rss/channel/item/description' \
+ | head -n 1 | sed -n 's/.*src="\([^"]\+\)".*/\1/p' )
+ wget "$pic" -nc && cp -v "$(basename "$pic")" xkcd.png
'';
PrivateTmp = true;
};
diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix
index c115bcb6..9b33595f 100644
--- a/makefu/2configs/bureautomation/default.nix
+++ b/makefu/2configs/bureautomation/default.nix
@@ -137,9 +137,9 @@ in {
++ frosch.binary_sensor
++ aramark.binary_sensor;
- sensor =
- # [{ platform = "version"; }] ++ # pyhaversion
- (import ./sensor/pollen.nix)
+ sensor = []
+ ++ [{ platform = "version"; }] # pyhaversion
+ ++ (import ./sensor/pollen.nix)
++ (import ./sensor/espeasy.nix)
++ (import ./sensor/airquality.nix)
++ ((import ./sensor/outside.nix) {inherit lib;})
@@ -238,6 +238,7 @@ in {
"camera.Autobahn_Singen"
"camera.puppies"
"camera.poorly_drawn_lines"
+ "camera.xkcd"
];
nachtlicht = [
"switch.nachtlicht_a"
diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix
index 63999467..3e3ef09a 100644
--- a/makefu/2configs/git/cgit-retiolum.nix
+++ b/makefu/2configs/git/cgit-retiolum.nix
@@ -19,6 +19,7 @@ let
cgit.desc = "Yet Another Check-Out System";
};
ebk-notify.cgit.desc = "Ebay Kleinanzeigen Notify";
+ kalauerbot.cgit.desc = "Kalauer König";
};
krebs-repos = mapAttrs make-krebs-repo {
diff --git a/makefu/2configs/tools/consoles.nix b/makefu/2configs/tools/consoles.nix
index 7090804d..e54ff4ff 100644
--- a/makefu/2configs/tools/consoles.nix
+++ b/makefu/2configs/tools/consoles.nix
@@ -5,5 +5,7 @@
hdl-dump
bin2iso
cue2pops
+ nx_game_info
+ hactool
];
}
diff --git a/makefu/2configs/tools/media.nix b/makefu/2configs/tools/media.nix
index 21d30229..d66ea776 100644
--- a/makefu/2configs/tools/media.nix
+++ b/makefu/2configs/tools/media.nix
@@ -7,6 +7,7 @@
vlc
mumble
mplayer
+ mpv
# quodlibet # exfalso
tinymediamanager
diff --git a/makefu/5pkgs/hactool/default.nix b/makefu/5pkgs/hactool/default.nix
new file mode 100644
index 00000000..0bdaeb4b
--- /dev/null
+++ b/makefu/5pkgs/hactool/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub
+}:
+stdenv.mkDerivation rec {
+ pname = "hactool";
+ name = "${pname}-${version}";
+ version = "1.4.0";
+
+ src = fetchFromGitHub {
+ owner = "SciresM";
+ repo = "hactool";
+ rev = version;
+ sha256 = "0305ngsnwm8npzgyhyifasi4l802xnfz19r0kbzzniirmcn4082d";
+ };
+ preBuild = ''
+ cp config.mk.template config.mk
+ '';
+ installPhase = ''
+ install -D hactool $out/bin/hactool
+ '';
+ buildInputs = [ ];
+ nativeBuildInputs = [ ];
+
+ meta = {
+ description = "tool to view information about, decrypt, and extract common file formats for the Nintendo Switch, especially Nintendo Content Archives";
+ homepage = https://github.com/SciresM/hactool;
+ license = stdenv.lib.licenses.isc;
+ platforms = stdenv.lib.platforms.linux;
+ maintainers = with stdenv.lib.maintainers; [ makefu ];
+ };
+}
diff --git a/makefu/5pkgs/nx_game_info/default.nix b/makefu/5pkgs/nx_game_info/default.nix
new file mode 100644
index 00000000..89880d59
--- /dev/null
+++ b/makefu/5pkgs/nx_game_info/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl , mono , unzip
+}:
+stdenv.mkDerivation rec {
+ pname = "NX_Game_Info";
+ name = "${pname}-${version}";
+ version = "0.7.1";
+
+ src = fetchurl {
+ url = "https://github.com/garoxas/NX_Game_Info/releases/download/v${version}/NX.Game.Info_${version}_cli.zip";
+ sha256 = "179hkgraydm5hg5fcs1xwh07cx7rbcfwklfak83f0sl1pbya542h";
+ };
+
+ sourceRoot = ".";
+ buildInputs = [ unzip ];
+ buildPhase = ":";
+ installPhase = ''
+ mkdir -p $out/{bin,lib}
+ cp * $out/lib/
+ cat > $out/bin/nxgameinfo_cli <<EOF
+ ${mono}/bin/mono $out/lib/nxgameinfo_cli.exe "\$@"
+ EOF
+ chmod +x $out/bin/nxgameinfo_cli
+ '';
+
+ meta = {
+ description = "Tool to read information from Nintendo Switch game files";
+ homepage = https://github.com/garoxas/NX_Game_Info;
+ license = stdenv.lib.licenses.gpl3;
+ platforms = stdenv.lib.platforms.linux;
+ maintainers = with stdenv.lib.maintainers; [ makefu ];
+ };
+}
diff --git a/tv/2configs/binary-cache/default.nix b/tv/2configs/binary-cache/default.nix
index 866434cb..f6eaba36 100644
--- a/tv/2configs/binary-cache/default.nix
+++ b/tv/2configs/binary-cache/default.nix
@@ -27,7 +27,7 @@
enable = true;
virtualHosts.nix-serve = {
serverAliases = [
- "cache.${config.krebs.build.host.name}.gg23"
+ "cache.${config.krebs.build.host.name}.hkw"
];
locations."/".extraConfig = ''
proxy_pass http://localhost:${toString config.services.nix-serve.port};
diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix
index 4d27b0ea..9db35184 100644
--- a/tv/2configs/default.nix
+++ b/tv/2configs/default.nix
@@ -16,6 +16,7 @@ with import <stockholm/lib>;
./backup.nix
./bash
./htop.nix
+ ./nets/hkw.nix
./nginx
./pki
./ssh.nix
diff --git a/tv/2configs/nets/hkw.nix b/tv/2configs/nets/hkw.nix
new file mode 100644
index 00000000..725e63b1
--- /dev/null
+++ b/tv/2configs/nets/hkw.nix
@@ -0,0 +1,69 @@
+{
+ krebs = {
+ dns.providers.hkw = "hosts";
+ hosts = {
+ nomic = {
+ nets.hkw = {
+ ip4 = {
+ addr = "10.23.1.110";
+ prefix = "10.23.1.0/24";
+ };
+ aliases = [
+ "nomic.hkw"
+ ];
+ ssh.port = 11423;
+ };
+ };
+ ok = {
+ external = true;
+ nets.hkw = {
+ ip4 = {
+ addr = "10.23.1.1";
+ prefix = "10.23.1.0/24";
+ };
+ aliases = [
+ "ok.hkw"
+ ];
+ };
+ };
+ wu = {
+ nets.hkw = {
+ ip4 = {
+ addr = "10.23.1.37";
+ prefix = "10.23.1.0/24";
+ };
+ aliases = [
+ "wu.hkw"
+ "cache.wu.hkw"
+ ];
+ ssh.port = 11423;
+ };
+ };
+ xu = {
+ nets.hkw = {
+ ip4 = {
+ addr = "10.23.1.38";
+ prefix = "10.23.1.0/24";
+ };
+ aliases = [
+ "xu.hkw"
+ "cache.xu.hkw"
+ ];
+ ssh.port = 11423;
+ };
+ };
+ zu = {
+ nets.hkw = {
+ ip4 = {
+ addr = "10.23.1.39";
+ prefix = "10.23.1.0/24";
+ };
+ aliases = [
+ "zu.hkw"
+ ];
+ ssh.port = 11423;
+ };
+ };
+ };
+ };
+}
diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix
index cc7a3989..a37498ba 100644
--- a/tv/2configs/nginx/public_html.nix
+++ b/tv/2configs/nginx/public_html.nix
@@ -9,7 +9,7 @@ with import <stockholm/lib>;
serverAliases = [
"localhost"
"${config.krebs.build.host.name}"
- "${config.krebs.build.host.name}.gg23"
+ "${config.krebs.build.host.name}.hkw"
"${config.krebs.build.host.name}.r"
];
locations."~ ^/~(.+?)(/.*)?\$".extraConfig = ''