From a2511aa7082409fa4fd40e4c9602431d39251c10 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 18 May 2023 15:04:23 +0200 Subject: [PATCH] add lidarr --- flake.lock | 24 +++++++-------- flake.nix | 1 + nixos/hosts/hades/overseerr/configuration.nix | 9 +++++- nixos/hosts/hades/overseerr/lidarr.nix | 30 +++++++++++++++++++ nixos/hosts/olympus/eevee/configuration.nix | 1 + notes/boot_full.md | 11 +++++++ 6 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 nixos/hosts/hades/overseerr/lidarr.nix create mode 100644 notes/boot_full.md diff --git a/flake.lock b/flake.lock index 041e26f..9a7d3f2 100644 --- a/flake.lock +++ b/flake.lock @@ -502,11 +502,11 @@ ] }, "locked": { - "lastModified": 1684157850, - "narHash": "sha256-xGHTCgvAxO5CgAL6IAgE/VGRX2wob2Y+DPyqpXJ32oQ=", + "lastModified": 1684321175, + "narHash": "sha256-V4EbM+jK7pvjKBaj0dgAiW9ultzDE27Nz5fRyu/ceMk=", "owner": "nix-community", "repo": "home-manager", - "rev": "c0deab0effd576e70343cb5df0c64428e0e0d010", + "rev": "59659243cd4ababda605e79b4a9c2e6d83e24c86", "type": "github" }, "original": { @@ -799,11 +799,11 @@ }, "nixpkgs_22-11": { "locked": { - "lastModified": 1684130981, - "narHash": "sha256-5IPp/rUAOogega5xuRoxcpfkwlGDAyWdizL0Tp2GA4s=", + "lastModified": 1684280442, + "narHash": "sha256-nC1/kfh6tpMQSLQalbNTNnireIlxvLLugrjZdasNh+I=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d41eea2839de7de0f2cbe4aa90fde5db8afcd30a", + "rev": "6c591e7adc514090a77209f56c9d0c551ab8530d", "type": "github" }, "original": { @@ -815,11 +815,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1684218676, - "narHash": "sha256-VOeTvnRk+U0S6Hj0b5cYlM7F2zi/o9G5aji1LZGUwfc=", + "lastModified": 1684398339, + "narHash": "sha256-Mrx9RW8e7dZRh6F+koFhKNKYhKk/GmCdsEpdYcQJ9rQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9318364586592bb95c8b1091427a501348960971", + "rev": "4105d3b66358485f1693c5650458bb8819efa8e7", "type": "github" }, "original": { @@ -946,11 +946,11 @@ }, "nur": { "locked": { - "lastModified": 1684218745, - "narHash": "sha256-UvP4puWuP+FD7/mxzd9UZZxeeggS5si3EyYMa6oZRR8=", + "lastModified": 1684397671, + "narHash": "sha256-buTLC8raxk9o4qkoRYiwbOm+8+2CtZyNtEk7wMRm6Tw=", "owner": "nix-community", "repo": "NUR", - "rev": "4543a5dcb060e40588ba753f773793e34e7e9489", + "rev": "c27cba4712f8eb426f8e2e7e2842cef89e672872", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d5ff657..8c40bb0 100644 --- a/flake.nix +++ b/flake.nix @@ -146,6 +146,7 @@ nixUnstable nil vault + yamllint (vault-push-approle-envs self { }) (vault-push-approles self { }) fast-repl diff --git a/nixos/hosts/hades/overseerr/configuration.nix b/nixos/hosts/hades/overseerr/configuration.nix index 263dd9a..36911a9 100644 --- a/nixos/hosts/hades/overseerr/configuration.nix +++ b/nixos/hosts/hades/overseerr/configuration.nix @@ -5,7 +5,9 @@ { ... }: { - imports = [ ]; + imports = [ + ./lidarr.nix + ]; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -20,6 +22,11 @@ networking.firewall.allowedTCPPorts = [ 5055 ]; + fileSystems."/mnt/storage" = { + device = "storage:/mnt/storage"; + fsType = "nfs"; + }; + virtualisation.podman.enable = true; # TODO: Write NixOS package https://github.com/NixOS/nixpkgs/issues/135885 virtualisation.oci-containers = { diff --git a/nixos/hosts/hades/overseerr/lidarr.nix b/nixos/hosts/hades/overseerr/lidarr.nix new file mode 100644 index 0000000..cba131e --- /dev/null +++ b/nixos/hosts/hades/overseerr/lidarr.nix @@ -0,0 +1,30 @@ +{ config, ... }: +let vs = config.vault-secrets.secrets; +in { + networking.firewall.allowedTCPPorts = [ 8686 ]; + + vault-secrets.secrets.lidarr = { + quoteEnvironmentValues = false; # Needed for docker + }; + + virtualisation.oci-containers.containers.lidarr = { + image = "randomninjaatk/lidarr-extended:latest"; + extraOptions = [ "--pull=newer" ]; + environment = { + TZ = "Europe/Amsterdam"; + dlClientSource = "deezer"; + enableVideoScript = "false"; + }; + environmentFiles = [ + # This file defines arlToken + "${vs.lidarr}/environment" + ]; + ports = [ "8686:8686" ]; + volumes = [ + "/var/lib/lidarr/config:/config" + "/var/lib/lidarr/downloads:/downloads-lidarr-extended" + "/mnt/storage/plex/Music:/music" + "/mnt/storage/plex/MusicVideos:/music-videos" + ]; + }; +} diff --git a/nixos/hosts/olympus/eevee/configuration.nix b/nixos/hosts/olympus/eevee/configuration.nix index e74c1a1..bf240a9 100644 --- a/nixos/hosts/olympus/eevee/configuration.nix +++ b/nixos/hosts/olympus/eevee/configuration.nix @@ -11,6 +11,7 @@ initrd = { kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; }; + loader.systemd-boot.configurationLimit = 5; }; fileSystems."/".options = [ "compress=zstd" ]; diff --git a/notes/boot_full.md b/notes/boot_full.md new file mode 100644 index 0000000..05ef336 --- /dev/null +++ b/notes/boot_full.md @@ -0,0 +1,11 @@ +# NixOS /boot full + +If `/boot` is full run the following commands: + +``` +sudo nix-collect-garbage -d +nix-env -p /mnt/nix/var/nix/profiles/system --delete-generations +2 +sudo nixos-rebuild boot --flake '.#eevee' +``` + +This should delete the older generations and free up some space