From 885ffb003ab84fa3e3a1ea5e85d2e5219fd9d23c Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 7 Jan 2025 16:35:16 +0000 Subject: [PATCH] Update LNBits version and modify desktop entries - Update LNBits version to v0.12.12 in flake.lock and flake.nix - Modify desktop entries for Zathura, Nsxiv-wrapper, Nvim-wrapper, and Mpv-wrapper in default.nix - Add arrstack.nix and Restic backups for Jellyfin configuration --- flake.lock | 7 ++-- flake.nix | 2 +- .../optional/desktop/common/xdg/default.nix | 20 ++++----- .../optional/desktop/common/xdg/scripts.nix | 17 -------- home/semita.nix | 1 + hosts/common/optional/docker/arrstack.nix | 42 +++++++++++++++++++ hosts/common/optional/docker/jellyfin.nix | 11 +++++ 7 files changed, 67 insertions(+), 33 deletions(-) delete mode 100644 home/common/optional/desktop/common/xdg/scripts.nix create mode 100644 hosts/common/optional/docker/arrstack.nix diff --git a/flake.lock b/flake.lock index d162f7c..153fa41 100644 --- a/flake.lock +++ b/flake.lock @@ -385,15 +385,16 @@ "poetry2nix": "poetry2nix" }, "locked": { - "lastModified": 1734684489, - "narHash": "sha256-df2CZXIEE8rQPyKNI7dzXzDGxTPERla8hvEiACyObgA=", + "lastModified": 1729199171, + "narHash": "sha256-NX/fzZfGppFkP7yoRJyg/0pKo9y4+agBnO4XCgbzp3U=", "owner": "lnbits", "repo": "lnbits", - "rev": "3900d2871d2e8ec5a00028eb4e2e59417c4fb08e", + "rev": "51c9d294cdb40c777b1048bbee267b49cdaf7a34", "type": "github" }, "original": { "owner": "lnbits", + "ref": "v0.12.12", "repo": "lnbits", "type": "github" } diff --git a/flake.nix b/flake.nix index 6da2dbb..a57fd50 100644 --- a/flake.nix +++ b/flake.nix @@ -33,7 +33,7 @@ }; lnbits = { - url = "github:lnbits/lnbits"; + url = "github:lnbits/lnbits/v0.12.12"; }; # Nix colors diff --git a/home/common/optional/desktop/common/xdg/default.nix b/home/common/optional/desktop/common/xdg/default.nix index e0a44a2..32685a3 100644 --- a/home/common/optional/desktop/common/xdg/default.nix +++ b/home/common/optional/desktop/common/xdg/default.nix @@ -1,35 +1,31 @@ -{pkgs, ...}: -{ - imports = [./scripts.nix]; - - +{pkgs, ...}: { xdg.desktopEntries = { firefox = { name = "Firefox"; exec = "${pkgs.firefox}/bin/firefox"; }; - zathura = { - name = "Zathura"; - exec = "${pkgs.zathura}/bin/zathura"; + zathura-wrapper = { + name = "Zathura-wrapper"; + exec = "st -T st-float -g 150x50 -e zathura %F"; terminal = false; mimeType = ["application/pdf"]; }; nsxiv-wrapper = { name = "Nsxiv-wrapper"; # exec = "nsxiv-wrapper %f"; - exec = "st -c xdg-open-nsxiv -T st-float -g 150x50 -e nsxiv %F"; + exec = "st -T st-float -g 150x50 -e nsxiv %F"; terminal = false; mimeType = ["image/*"]; }; nvim-wrapper = { name = "Nvim-wrapper"; - exec = "st -c xdg-open-nvim -T st-float -g 150x50 -e nvim %F"; + exec = "st -T st-float -g 150x50 -e nvim %F"; terminal = false; mimeType = ["text/*"]; }; mpv-wrapper = { name = "Mpv-wrapper"; - exec = "st -c xdg-open-mpv -T st-float -g 150x50 -e mpv %F"; + exec = "st -T st-float -g 150x50 -e mpv %F"; terminal = false; mimeType = ["video/*"]; }; @@ -38,7 +34,7 @@ xdg.mimeApps = { enable = true; defaultApplications = { - "application/pdf" = "zathura.desktop"; + "application/pdf" = "zathura-wrapper.desktop"; # text "text/html" = "firefox.desktop"; diff --git a/home/common/optional/desktop/common/xdg/scripts.nix b/home/common/optional/desktop/common/xdg/scripts.nix deleted file mode 100644 index 6dac97b..0000000 --- a/home/common/optional/desktop/common/xdg/scripts.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - (writeShellScriptBin "nsxiv-wrapper" '' - # Script to open image files with nsxiv - monitor_name=$(get-focused-monitor) - monitor_info=$(${xorg.xrandr}/bin/xrandr | grep "$monitor_name") - - width=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f1) - height=$(echo $monitor_info | grep -oP '\d+x\d+' | cut -dx -f2) - - scale_width=$(( $width/4 + $width/2 )) - scale_height=$(( $height/4 + $height/2 )) - - echo "$1" | ${nsxiv}/bin/nsxiv -ioq -g "$scale_width"x"$scale_height" -N float - '') - ]; -} diff --git a/home/semita.nix b/home/semita.nix index 1827a3b..e761f11 100644 --- a/home/semita.nix +++ b/home/semita.nix @@ -18,6 +18,7 @@ ./common/optional/notes.nix ./common/optional/yazi.nix ./common/optional/transmission.nix + ./common/optional/desktop/common/xdg ]; home.packages = [ diff --git a/hosts/common/optional/docker/arrstack.nix b/hosts/common/optional/docker/arrstack.nix new file mode 100644 index 0000000..ccebeab --- /dev/null +++ b/hosts/common/optional/docker/arrstack.nix @@ -0,0 +1,42 @@ +{config, pkgs, ...}: let + # openVpnPwd = config.sops.secrets."software/proton/openvpn/password".path; + # openVpnUser = config.sops.secrets."software/proton/openvpn/username".path; +in { + services.restic.backups = { + daily = { + paths = [ + "/srv/media-server/arrstack" + ]; + exclude = [ + ]; + }; + }; + + virtualisation.arion = { + backend = "podman-socket"; + projects.jellyfin = { + settings = { + services.gluetun.service = { + ports = [ + "8076:8076" + ]; + image = "qmcgaw/gluetun"; + restart = "always"; + volumes = [ + "/srv/media-server/arrstack/gluetun:/gluetun" + ]; + environment = { + VPN_SERVICE_PROVIDE = "protonvpn"; + VPN_TYPE = "openvpn"; + + SERVER_COUNTRIES = "Switzerland"; + }; + devices = ["/dev/net/tun:/dev/net/tun"]; + command = [ + "${pkgs.writeScript "entrypoint" "export TEST=test"}" + ]; + }; + }; + }; + }; +} diff --git a/hosts/common/optional/docker/jellyfin.nix b/hosts/common/optional/docker/jellyfin.nix index d439ebe..993263b 100644 --- a/hosts/common/optional/docker/jellyfin.nix +++ b/hosts/common/optional/docker/jellyfin.nix @@ -1,4 +1,14 @@ { + services.restic.backups = { + daily = { + paths = [ + "/srv/media-server/jellyfin" + ]; + exclude = [ + ]; + }; + }; + virtualisation.arion = { backend = "podman-socket"; projects.jellyfin = { @@ -21,6 +31,7 @@ environment = { PUID = "1000"; PGID = "1000"; + DOCKER_MODS="linuxserver/mods:jellyfin-opencl-intel"; }; devices = ["/dev/dri:/dev/dri"]; };