From 93606315b99a2540c5859d93eb2377ae32fa6506 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 4 Aug 2020 21:25:09 +0200 Subject: [PATCH 01/10] shack/share: downgrade samba security --- krebs/2configs/shack/share.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/krebs/2configs/shack/share.nix b/krebs/2configs/shack/share.nix index 247b9ee7d..465d6ef69 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 ''; }; } From 57e21968fcef02ddbaf0d87a06358542232b4d90 Mon Sep 17 00:00:00 2001 From: Neos Date: Mon, 10 Aug 2020 20:16:12 +0200 Subject: [PATCH 02/10] =?UTF-8?q?Changed=20Gie=C3=9Fzeit=20to=2010=20secon?= =?UTF-8?q?ds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- krebs/2configs/shack/glados/multi/wasser.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix index 0a7ffc41c..6f3dc98ad 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 { From 5ccb8e08e82a171749e9f93fea38b2c4d55cd868 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 12 Aug 2020 12:23:01 +0200 Subject: [PATCH 03/10] ma bureautomation: fetch latest xkcd comic --- makefu/2configs/bureautomation/camera/comic.nix | 4 ++++ makefu/2configs/bureautomation/comic-updater.nix | 12 ++++++++++-- makefu/2configs/bureautomation/default.nix | 7 ++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/makefu/2configs/bureautomation/camera/comic.nix b/makefu/2configs/bureautomation/camera/comic.nix index a847b0add..a523d032e 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 5f26bc2c7..1e2440939 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 c115bcb6c..9b33595f4 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" From 84da9293b05160f3a55b598de16e88b26c82520c Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 12 Aug 2020 20:45:32 +0200 Subject: [PATCH 04/10] gitlab-ci: debug gpg issue --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a7a4e605..cf8f6e8f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,8 @@ 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: stage: test From a7f67a851b9cc2988169b96b06a9befc89de4c1c Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 12 Aug 2020 23:10:48 +0200 Subject: [PATCH 05/10] gitlab-ci: run only on tags we have some rogue non-nix runners going around on gitlab-ci therefore we now tag the runners shacklan - inside the shack lan nix - has nix installed --- .gitlab-ci.yml | 12 ++++++++++++ krebs/2configs/shack/gitlab-runner.nix | 2 ++ 2 files changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cf8f6e8f4..76a304af8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,8 @@ before_script: - 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 @@ -23,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 @@ -31,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 @@ -46,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 @@ -60,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 5f2ca02d9..bd391851a 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= # REGISTRATION_TOKEN= + # RUNNER_TAG_LIST=nix,shacklan + # RUNNER_NAME=stockholm-runner-$name registrationConfigFile = ; #gracefulTermination = true; }; From 568d45dde9b01f50a89b0b1320f0fa05fe415909 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Aug 2020 21:47:33 +0200 Subject: [PATCH 06/10] ma pkgs.hactool: init at 1.4.0 --- .../data/secrets/bureautomation/citadel.nix | 4 +++ makefu/2configs/git/cgit-retiolum.nix | 1 + makefu/5pkgs/hactool/default.nix | 30 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 makefu/0tests/data/secrets/bureautomation/citadel.nix create mode 100644 makefu/5pkgs/hactool/default.nix diff --git a/makefu/0tests/data/secrets/bureautomation/citadel.nix b/makefu/0tests/data/secrets/bureautomation/citadel.nix new file mode 100644 index 000000000..b4433109c --- /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/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 639994674..3e3ef09a8 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/5pkgs/hactool/default.nix b/makefu/5pkgs/hactool/default.nix new file mode 100644 index 000000000..fc6f17a9d --- /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 = "PulseAudio volumene meter"; + homepage = http://0pointer.de/lennart/projects/pavumeter; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ makefu ]; + }; +} From b663b01807d9137e6c83a47f737fc8aa33be2a80 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Aug 2020 22:14:10 +0200 Subject: [PATCH 07/10] ma pkgs.nx_game_info: init at 0.7.1 --- makefu/5pkgs/nx_game_info/default.nix | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 makefu/5pkgs/nx_game_info/default.nix diff --git a/makefu/5pkgs/nx_game_info/default.nix b/makefu/5pkgs/nx_game_info/default.nix new file mode 100644 index 000000000..89880d59c --- /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 < Date: Sun, 16 Aug 2020 22:15:43 +0200 Subject: [PATCH 08/10] ma pkgs.hactool: fix metadata --- makefu/5pkgs/hactool/default.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/makefu/5pkgs/hactool/default.nix b/makefu/5pkgs/hactool/default.nix index fc6f17a9d..a4ebd9f77 100644 --- a/makefu/5pkgs/hactool/default.nix +++ b/makefu/5pkgs/hactool/default.nix @@ -1,5 +1,4 @@ -{ lib, stdenv, fetchFromGitHub -}: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "hactool"; name = "${pname}-${version}"; @@ -9,21 +8,21 @@ stdenv.mkDerivation rec { owner = "SciresM"; repo = "hactool"; rev = version; - sha256 = "0305ngsnwm8npzgyhyifasi4l802xnfz19r0kbzzniirmcn4082d"; + sha256 = "162zv7my79a5ssn6zwk1yh64jjwlzr9kiplbpyvj4ly79dpngwyn"; }; + preBuild = '' cp config.mk.template config.mk ''; + installPhase = '' install -D hactool $out/bin/hactool ''; - buildInputs = [ ]; - nativeBuildInputs = [ ]; meta = { - description = "PulseAudio volumene meter"; - homepage = http://0pointer.de/lennart/projects/pavumeter; - license = stdenv.lib.licenses.gpl2; + 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 ]; }; From 05e3e79d2d320f5c5fa31cf36ca83a22639fd056 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Aug 2020 22:17:09 +0200 Subject: [PATCH 09/10] ma tools: add newly packaged tools --- makefu/2configs/tools/consoles.nix | 2 ++ makefu/2configs/tools/media.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/makefu/2configs/tools/consoles.nix b/makefu/2configs/tools/consoles.nix index 7090804d4..e54ff4ff5 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 21d302297..d66ea7760 100644 --- a/makefu/2configs/tools/media.nix +++ b/makefu/2configs/tools/media.nix @@ -7,6 +7,7 @@ vlc mumble mplayer + mpv # quodlibet # exfalso tinymediamanager From 1d78ac0d6a78048903cc159b82ec6b405b7e16ab Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 16 Aug 2020 22:42:51 +0200 Subject: [PATCH 10/10] pkgs.hactool: fix sha256sum --- makefu/5pkgs/hactool/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/makefu/5pkgs/hactool/default.nix b/makefu/5pkgs/hactool/default.nix index a4ebd9f77..0bdaeb4be 100644 --- a/makefu/5pkgs/hactool/default.nix +++ b/makefu/5pkgs/hactool/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub +}: stdenv.mkDerivation rec { pname = "hactool"; name = "${pname}-${version}"; @@ -8,16 +9,16 @@ stdenv.mkDerivation rec { owner = "SciresM"; repo = "hactool"; rev = version; - sha256 = "162zv7my79a5ssn6zwk1yh64jjwlzr9kiplbpyvj4ly79dpngwyn"; + 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";