diff --git a/config/hosts/goliath.nix b/config/hosts/goliath.nix index 4f7bc5c0..f704c24d 100644 --- a/config/hosts/goliath.nix +++ b/config/hosts/goliath.nix @@ -14,7 +14,6 @@ users.kat.guiX11Full users.kat.services.weechat services.nginx - services.katsplash services.restic services.zfs ]; diff --git a/config/hosts/rinnosuke.nix b/config/hosts/rinnosuke.nix index d24ba7f5..e0c66402 100644 --- a/config/hosts/rinnosuke.nix +++ b/config/hosts/rinnosuke.nix @@ -27,14 +27,5 @@ }; }; - services.nginx.virtualHosts = - let - splashy = pkgs.host-splash-site config.networking.hostName; - in - kw.virtualHostGen { - networkFilter = [ "public" ]; - block.locations."/" = { root = splashy; }; - }; - system.stateVersion = "21.11"; } diff --git a/config/profiles/hardware/raspi.nix b/config/profiles/hardware/raspi.nix index 030497ed..0d2d166d 100644 --- a/config/profiles/hardware/raspi.nix +++ b/config/profiles/hardware/raspi.nix @@ -11,7 +11,6 @@ generic-extlinux-compatible.enable = true; }; consoleLogLevel = lib.mkDefault 7; - kernelPackages = pkgs.linuxPackages_rpi1; kernelModules = mkForce [ "loop" "atkbd" ]; initrd = { includeDefaultModules = false; diff --git a/config/services/katsplash.nix b/config/services/katsplash.nix deleted file mode 100644 index 2677959f..00000000 --- a/config/services/katsplash.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, kw, ... }: - -let splashy = pkgs.host-splash-site config.networking.hostName; in -{ - services.nginx.virtualHosts = kw.virtualHostGen { - networkFilter = [ "private" ]; - block.locations."/" = { root = splashy; }; - }; -} diff --git a/config/tf b/config/tf index bb2c4662..84b1742d 160000 --- a/config/tf +++ b/config/tf @@ -1 +1 @@ -Subproject commit bb2c466204d46307e3e374a526268c37ca4f7839 +Subproject commit 84b1742d36714279de336e2bee37848d0b3b6de8 diff --git a/overlays/local/default.nix b/overlays/local/default.nix index c7fa37ef..5ee98f0c 100644 --- a/overlays/local/default.nix +++ b/overlays/local/default.nix @@ -5,4 +5,8 @@ final: prev: { vfio-vm = final.callPackage ./vm.nix { }; vfio-vm-pinning = final.callPackage ./vm-pinning.nix { }; vfio-disk-mapper = final.callPackage ./disk-mapper.nix { }; + xbackbone = final.callPackage ./xbackbone.nix { }; + waybar-gpg = final.callPackage ./waybar-gpg { }; + waybar-konawall = final.callPackage ./waybar-konawall { }; + hedgedoc-cli = final.callPackage ./hedgedoc-cli.nix { }; } diff --git a/overlays/local/hedgedoc-cli.nix b/overlays/local/hedgedoc-cli.nix new file mode 100644 index 00000000..cc6c4b53 --- /dev/null +++ b/overlays/local/hedgedoc-cli.nix @@ -0,0 +1,27 @@ +{ lib, stdenv, makeWrapper, fetchFromGitHub, jq, curl, wget }: + +stdenv.mkDerivation { + pname = "hedgedoc-cli"; + version = "2021-05-17"; + + src = fetchFromGitHub { + owner = "hedgedoc"; + repo = "cli"; + rev = "8b13b8836cf330921856907d905421d34a1e645c"; + sha256 = "1971v02jxlnxi09h0c6w3nzgq8w7b6ry09hjnvggypgxfjh53lhk"; + }; + + paths = lib.makeBinPath [ + jq curl wget + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = '' + install -Dm0755 bin/hedgedoc $out/bin/hdcli + wrapProgram $out/bin/hdcli \ + --prefix PATH : "$paths" + ''; +} diff --git a/overlays/local/waybar-gpg/default.nix b/overlays/local/waybar-gpg/default.nix new file mode 100644 index 00000000..072e4293 --- /dev/null +++ b/overlays/local/waybar-gpg/default.nix @@ -0,0 +1,5 @@ +{ wrapShellScriptBin, pkgs }: + +wrapShellScriptBin "kat-gpg-status" ./kat-gpg-status.sh { + depsRuntimePath = with pkgs; [ coreutils gnupg ]; +} diff --git a/overlays/local/waybar-gpg/kat-gpg-status.sh b/overlays/local/waybar-gpg/kat-gpg-status.sh new file mode 100644 index 00000000..0a8fceec --- /dev/null +++ b/overlays/local/waybar-gpg/kat-gpg-status.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eu +set -o pipefail + +if gpg --card-status &> /dev/null; then + user="$(gpg --card-status | grep 'Login data' | awk '{print $NF}')"; + status='{"text": "", "alt": "User: '"$user"'", "class": "enabled"}' +else + status='{"text": "", "alt": "No card is connected.", "class": "disabled"}' +fi + +echo $status diff --git a/overlays/local/waybar-konawall/default.nix b/overlays/local/waybar-konawall/default.nix new file mode 100644 index 00000000..729b3111 --- /dev/null +++ b/overlays/local/waybar-konawall/default.nix @@ -0,0 +1,17 @@ +{ stdenv, wrapShellScriptBin, pkgs }: + +let + toggle = wrapShellScriptBin "konawall-toggle" ./toggle.sh { }; + status = wrapShellScriptBin "konawall-status" ./status.sh { }; +in +stdenv.mkDerivation { + pname = "konawall-toggle"; + version = "0.0.1"; + unpackPhase = "true"; + installPhase = '' + mkdir -p $out/bin + cp ${status}/bin/konawall-status $out/bin/konawall-status + cp ${toggle}/bin/konawall-toggle $out/bin/konawall-toggle + chmod +x $out/bin/konawall-{status,toggle} + ''; +} diff --git a/overlays/local/waybar-konawall/status.sh b/overlays/local/waybar-konawall/status.sh new file mode 100644 index 00000000..5e7c69a5 --- /dev/null +++ b/overlays/local/waybar-konawall/status.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -eu +set -o pipefail + +sleep 0.5s + +if systemctl --user is-active konawall-rotation.timer --quiet; then + status='{"text": "", "alt": "Konawall is enabled.", "class": "enabled"}' +else + status='{"text": "", "alt": "Konawall is disabled.", "class": "disabled"}' +fi + +echo $status diff --git a/overlays/local/waybar-konawall/toggle.sh b/overlays/local/waybar-konawall/toggle.sh new file mode 100644 index 00000000..0802906e --- /dev/null +++ b/overlays/local/waybar-konawall/toggle.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eu +set -o pipefail + + +if systemctl --user is-active konawall-rotation.timer --quiet; then + systemctl --user stop konawall-rotation.timer +else + systemctl --user start konawall-rotation.timer +fi + +pkill -SIGRTMIN+8 waybar diff --git a/overlays/local/xbackbone.nix b/overlays/local/xbackbone.nix new file mode 100644 index 00000000..115c5e2d --- /dev/null +++ b/overlays/local/xbackbone.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, php +, fetchurl +, unzip +}: + +stdenv.mkDerivation rec { + pname = "XBackBone"; + version = "3.5.0"; + + nativeBuildInputs = [ + unzip + ]; + + src = fetchurl { + url = "https://github.com/SergiX44/XBackBone/releases/download/${version}/release-v${version}.zip"; + sha256 = "17p180yhsgjsm9pa5vkmqfrk71avss33vw2bjb6py90dwknbkipl"; + }; + + sourceRoot = "."; + + installPhase = '' + mkdir -p $out + mv * $out + ''; + + meta = with lib; { + description = "A lightweight file manager with full ShareX, Screencloud support and more"; + homepage = "https://xbackbone.app/"; + license = with licenses; agpl3; + maintainers = with maintainers; [ kittywitch ]; + platforms = with platforms; unix; + }; +}