diff --git a/home/lilac.nix b/home/lilac.nix index 8ac9712..9034d7d 100644 --- a/home/lilac.nix +++ b/home/lilac.nix @@ -10,6 +10,10 @@ helix ]; + imports = [ + ./modules/ripping.nix + ]; + programs.git = { enable = true; settings = { diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index f50cdf1..5b94ced 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -11,6 +11,7 @@ ../../modules/site.nix ../../modules/gitea.nix ../../modules/navidrome.nix + ../../modules/immich.nix ]; network.node = "desktop"; @@ -82,6 +83,29 @@ AllowSuspendThenHibernate = "no"; }; + systemd.services.amdgpu-performance = { + description = "Force AMD GPU performance level to high"; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "oneshot"; + ExecStart = '' + ${pkgs.bash}/bin/bash -c ' + for gpu in /sys/class/drm/card*/device; do + if [ -f "$gpu/vendor" ] && [ "$(cat "$gpu/vendor")" = "0x1002" ]; then + echo high > "$gpu/power_dpm_force_performance_level" + fi + done + ' + ''; + }; + }; + + environment.systemPackages = with pkgs; [ + whipper + flac + ]; + nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; system.stateVersion = "26.05"; diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index 303a843..547ce48 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -16,6 +16,10 @@ boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelParams = [ + "amdgpu.runpm=0" + ]; + fileSystems."/" = { device = "/dev/disk/by-uuid/d7450680-7d53-4842-83c5-7fc32526dff1"; fsType = "ext4"; diff --git a/modules/immich.nix b/modules/immich.nix new file mode 100644 index 0000000..4740cc2 --- /dev/null +++ b/modules/immich.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + services.immich.enable = true; + services.immich.port = 2283; + services.immich.host = "0.0.0.0"; + services.immich.mediaLocation = "/var/lib/media/images"; + + services.caddy.enable = true; + services.caddy.virtualHosts."image.grasswren.net".extraConfig = '' + reverse_proxy localhost:2283 + ''; + + networking.firewall.allowedTCPPorts = [ 2283 ]; +} diff --git a/modules/ripping.nix b/modules/ripping.nix new file mode 100644 index 0000000..f3918dc --- /dev/null +++ b/modules/ripping.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + whipper + beets + ]; + + programs.beets = { + enable = true; + + settings = { + directory = "/var/lib/media/music"; + library = "/var/lib/media/music/library.db"; + + plugins = [ + "fetchart" + "embedart" + "scrub" + ]; + + per_disc_numbering = true; + + import = { + move = true; + copy = false; + write = true; + resume = "ask"; + incremental = false; + timid = false; + }; + + paths = { + default = "$albumartist/$album%aunique{}/$track - $title"; + }; + + fetchart.auto = true; + embedart.auto = true; + scrub.auto = true; + }; + }; +}