diff --git a/flake.nix b/flake.nix index 04c82f4..a090716 100644 --- a/flake.nix +++ b/flake.nix @@ -1,48 +1,48 @@ { - description = "A simple NixOS flake"; + description = "A simple NixOS flake"; - inputs = { - unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; - moppkgs.url = "github:Mop-u/moppkgs"; + inputs = { + unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05"; + moppkgs.url = "github:Mop-u/moppkgs"; - sidonia = { - url = "github:Mop-u/sidonia"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.unstable.follows = "unstable"; - inputs.moppkgs.follows = "moppkgs"; - }; + sidonia = { + url = "github:Mop-u/sidonia"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.unstable.follows = "unstable"; + inputs.moppkgs.follows = "moppkgs"; + }; - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - nix-minecraft = { - url = "github:Infinidoge/nix-minecraft"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + nix-minecraft = { + url = "github:Infinidoge/nix-minecraft"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - steam-fetcher = { - url = "github:aidalgol/nix-steam-fetcher"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + steam-fetcher = { + url = "github:aidalgol/nix-steam-fetcher"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - steam-servers = { - url = "github:scottbot95/nix-steam-servers"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.steam-fetcher.follows = "steam-fetcher"; - }; + steam-servers = { + url = "github:scottbot95/nix-steam-servers"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.steam-fetcher.follows = "steam-fetcher"; }; + }; - outputs = - inputs@{ self, nixpkgs, ... }: - { - nixosConfigurations = inputs.sidonia.mkSidonia ./hosts { - specialArgs = { inherit inputs; }; - modules = [ - inputs.sops-nix.nixosModules.sops - ]; - }; - }; + outputs = + inputs@{ self, nixpkgs, ... }: + { + nixosConfigurations = inputs.sidonia.mkSidonia ./hosts { + specialArgs = { inherit inputs; }; + modules = [ + inputs.sops-nix.nixosModules.sops + ]; + }; + }; } diff --git a/hosts/kaoru/default.nix b/hosts/kaoru/default.nix index 5653334..e4e65b8 100644 --- a/hosts/kaoru/default.nix +++ b/hosts/kaoru/default.nix @@ -1,11 +1,11 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ ./os ]; - home-manager.users.${config.sidonia.userName}.imports = [ ./home ]; + imports = [ ./os ]; + home-manager.users.${config.sidonia.userName}.imports = [ ./home ]; } diff --git a/hosts/kaoru/home/default.nix b/hosts/kaoru/home/default.nix index 6d1792b..9ca23e2 100644 --- a/hosts/kaoru/home/default.nix +++ b/hosts/kaoru/home/default.nix @@ -1,15 +1,15 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./home.nix - ./monitors.nix - ]; - + imports = [ + ./home.nix + ./monitors.nix + ]; + } diff --git a/hosts/kaoru/home/home.nix b/hosts/kaoru/home/home.nix index 2a2f7b0..4787846 100644 --- a/hosts/kaoru/home/home.nix +++ b/hosts/kaoru/home/home.nix @@ -1,51 +1,51 @@ { - osConfig, - config, - pkgs, - lib, - ... + osConfig, + config, + pkgs, + lib, + ... }: { - home.packages = [ - pkgs.wireshark - (pkgs.quartusPackages.pro.latestWithDevices [ "cyclone10gx" ]) - pkgs.fiano - pkgs.uefitoolPackages.old-engine - pkgs.coreboot-utils - pkgs.wineWow64Packages.full - ]; + home.packages = [ + pkgs.wireshark + (pkgs.quartusPackages.pro.latestWithDevices [ "cyclone10gx" ]) + pkgs.fiano + pkgs.uefitoolPackages.old-engine + pkgs.coreboot-utils + pkgs.wineWow64Packages.full + ]; - xdg.autostart.entries = lib.mkIf osConfig.services.asusd.enable [ - "${osConfig.services.asusd.package}/share/applications/rog-control-center.desktop" - ]; + xdg.autostart.entries = lib.mkIf osConfig.services.asusd.enable [ + "${osConfig.services.asusd.package}/share/applications/rog-control-center.desktop" + ]; - programs = { - surfer.enable = true; - gtkwave.enable = true; - vscodium = { - profiles.default = { - extensions = with pkgs.vsxExtensionsFor config.programs.vscodium.package; [ - mbehr1.vsc-webshark - #surfer-project.surfer - lramseyer.vaporview - redhat.vscode-yaml - christian-kohler.path-intellisense - llvm-vs-code-extensions.vscode-clangd - b-lang-org.language-bh - hudson-river-trading.vscode-slang - ms-vscode.hexeditor - #sankooc.pcapviewer - ]; - userSettings = { - "redhat.telemetry.enabled" = false; - "vsc-webshark.sharkdFullPath" = "${pkgs.wireshark}/bin/sharkd"; - "slang.path" = "${lib.getExe pkgs.slang-server}"; - "workbench.editorAssociations" = { - #"*.pcap" = "proto.pcapng"; - "*.pcap" = "vsc-webshark.pcap"; - }; - }; - }; + programs = { + surfer.enable = true; + gtkwave.enable = true; + vscodium = { + profiles.default = { + extensions = with pkgs.vsxExtensionsFor config.programs.vscodium.package; [ + mbehr1.vsc-webshark + #surfer-project.surfer + lramseyer.vaporview + redhat.vscode-yaml + christian-kohler.path-intellisense + llvm-vs-code-extensions.vscode-clangd + b-lang-org.language-bh + hudson-river-trading.vscode-slang + ms-vscode.hexeditor + #sankooc.pcapviewer + ]; + userSettings = { + "redhat.telemetry.enabled" = false; + "vsc-webshark.sharkdFullPath" = "${pkgs.wireshark}/bin/sharkd"; + "slang.path" = "${lib.getExe pkgs.slang-server}"; + "workbench.editorAssociations" = { + #"*.pcap" = "proto.pcapng"; + "*.pcap" = "vsc-webshark.pcap"; + }; }; + }; }; + }; } diff --git a/hosts/kaoru/home/monitors.nix b/hosts/kaoru/home/monitors.nix index 7f1c270..9340c17 100644 --- a/hosts/kaoru/home/monitors.nix +++ b/hosts/kaoru/home/monitors.nix @@ -1,62 +1,62 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: let - laptop = "n=eDP-1"; - zowie = "d%ZOWIE"; - ultrawide = "d%P40w-20"; + laptop = "n=eDP-1"; + zowie = "d%ZOWIE"; + ultrawide = "d%P40w-20"; in { - wayland.windowManager.niri.settings.output = [ - { - _args = [ "Lenovo Group Limited P40w-20 V9095052" ]; - layout.default-column-width.proportion = 1.0 / 3.0; - } - ]; - services.shikane = { - enable = true; - settings.profile = [ - { - name = "Docked at Workstation"; - output = [ - { - search = laptop; - enable = false; - } - { - search = zowie; - enable = true; - scale = 1.0; - mode = "1920x1080@60"; - position = "4800,400"; - } - { - search = ultrawide; - enable = true; - scale = 1.07; - mode = "5120x2160@74.98"; - position = "0,0"; - } - ]; - } - { - name = "Undocked"; - output = [ - { - search = laptop; - enable = true; - scale = 1.0; - adaptive_sync = true; - mode = "2560x1600@165"; - position = "0,0"; - } - ]; - } + wayland.windowManager.niri.settings.output = [ + { + _args = [ "Lenovo Group Limited P40w-20 V9095052" ]; + layout.default-column-width.proportion = 1.0 / 3.0; + } + ]; + services.shikane = { + enable = true; + settings.profile = [ + { + name = "Docked at Workstation"; + output = [ + { + search = laptop; + enable = false; + } + { + search = zowie; + enable = true; + scale = 1.0; + mode = "1920x1080@60"; + position = "4800,400"; + } + { + search = ultrawide; + enable = true; + scale = 1.07; + mode = "5120x2160@74.98"; + position = "0,0"; + } + ]; + } + { + name = "Undocked"; + output = [ + { + search = laptop; + enable = true; + scale = 1.0; + adaptive_sync = true; + mode = "2560x1600@165"; + position = "0,0"; + } ]; - }; + } + ]; + }; } diff --git a/hosts/kaoru/os/configuration.nix b/hosts/kaoru/os/configuration.nix index 24ae5bf..fee74d3 100644 --- a/hosts/kaoru/os/configuration.nix +++ b/hosts/kaoru/os/configuration.nix @@ -1,43 +1,43 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - networking.hostName = "kaoru"; - nix.settings = { - keep-outputs = true; - max-jobs = 4; - cores = 8; # avoid thermal throttling - }; - services = { - supergfxd.enable = true; - asusd.enable = true; - }; - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "mauve"; - }; + networking.hostName = "kaoru"; + nix.settings = { + keep-outputs = true; + max-jobs = 4; + cores = 8; # avoid thermal throttling + }; + services = { + supergfxd.enable = true; + asusd.enable = true; + }; + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "mauve"; + }; - system.stateVersion = "23.11"; - programs.kdeconnect.enable = true; - programs.gpu-screen-recorder.enable = true; - sidonia = { - userName = "hazama"; - ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINfNV3Z/LI/4ItskdADIC4JWqfW3Wae4TRK/Ahos5TgB hazama@kaoru"; - text.comicCode.enable = true; - services.distributedBuilds.client.enable = false; - isLaptop = true; - geolocation.enable = true; - desktop.enable = true; - }; - sops = { - defaultSopsFile = ../../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age.keyFile = "/home/${config.sidonia.userName}/.config/sops/age/keys.txt"; - }; + system.stateVersion = "23.11"; + programs.kdeconnect.enable = true; + programs.gpu-screen-recorder.enable = true; + sidonia = { + userName = "hazama"; + ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINfNV3Z/LI/4ItskdADIC4JWqfW3Wae4TRK/Ahos5TgB hazama@kaoru"; + text.comicCode.enable = true; + services.distributedBuilds.client.enable = false; + isLaptop = true; + geolocation.enable = true; + desktop.enable = true; + }; + sops = { + defaultSopsFile = ../../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/${config.sidonia.userName}/.config/sops/age/keys.txt"; + }; } diff --git a/hosts/kaoru/os/default.nix b/hosts/kaoru/os/default.nix index df2ba24..3ce8606 100644 --- a/hosts/kaoru/os/default.nix +++ b/hosts/kaoru/os/default.nix @@ -1,17 +1,17 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./configuration.nix - ./hardware-configuration.nix - ./lix.nix - ./networkMounts.nix - ./virtualbox.nix - ]; - + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ./lix.nix + ./networkMounts.nix + ./virtualbox.nix + ]; + } diff --git a/hosts/kaoru/os/hardware-configuration.nix b/hosts/kaoru/os/hardware-configuration.nix index 0250a55..b30b8b0 100644 --- a/hosts/kaoru/os/hardware-configuration.nix +++ b/hosts/kaoru/os/hardware-configuration.nix @@ -1,146 +1,146 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - hardware.enableRedistributableFirmware = true; - - boot.loader = { - efi.canTouchEfiVariables = false; - grub = { - enable = true; - devices = [ "nodev" ]; - efiSupport = true; - useOSProber = true; - configurationLimit = 10; - }; - }; - - boot.initrd.availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "thunderbolt_net" - "vmd" - "nvme" - "usbhid" - "usb_storage" - "sd_mod" - "sdhci_pci" - "aesni_intel" - "cryptd" - ]; - boot.initrd.kernelModules = [ - "thunderbolt" - ]; - - boot.kernelPackages = pkgs.linuxPackages_6_18; + hardware.enableRedistributableFirmware = true; - boot.kernelModules = [ - "kvm-intel" - "r8125" # realtek PCIe 2.5Gbe - "snd_usb_audio" - ]; - boot.extraModulePackages = with config.boot.kernelPackages; [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/75980f2d-cc48-4245-b6c5-31bf9d0465bc"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/8F59-FE20"; - fsType = "vfat"; - options = [ - "fmask=0022" - "dmask=0022" - ]; + boot.loader = { + efi.canTouchEfiVariables = false; + grub = { + enable = true; + devices = [ "nodev" ]; + efiSupport = true; + useOSProber = true; + configurationLimit = 10; }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/efa4d278-62f5-48ce-8fdd-6571fa61ea1a"; } + }; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "thunderbolt_net" + "vmd" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + "aesni_intel" + "cryptd" + ]; + boot.initrd.kernelModules = [ + "thunderbolt" + ]; + + boot.kernelPackages = pkgs.linuxPackages_6_18; + + boot.kernelModules = [ + "kvm-intel" + "r8125" # realtek PCIe 2.5Gbe + "snd_usb_audio" + ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/75980f2d-cc48-4245-b6c5-31bf9d0465bc"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/8F59-FE20"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" ]; - - boot.initrd.luks.devices."luksroot" = { - allowDiscards = true; - device = "/dev/disk/by-uuid/04f8ed32-deda-4e3d-a91b-e9e6470a0ac9"; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/efa4d278-62f5-48ce-8fdd-6571fa61ea1a"; } + ]; + + boot.initrd.luks.devices."luksroot" = { + allowDiscards = true; + device = "/dev/disk/by-uuid/04f8ed32-deda-4e3d-a91b-e9e6470a0ac9"; + }; + + boot.initrd.luks.devices."luksswap" = { + allowDiscards = true; + device = "/dev/disk/by-uuid/8d864adf-9a85-433f-8919-eb6a8371c077"; + }; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s20f0u1u4.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nix.settings.system-features = [ "gccarch-alderlake" ]; + nixpkgs.hostPlatform = { + #gcc.arch = "alderlake"; + #gcc.tune = "alderlake"; + system = "x86_64-linux"; + }; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + environment.systemPackages = with pkgs; [ + nvtopPackages.full + intel-gpu-tools + ]; + hardware.graphics.extraPackages = with pkgs; [ + # modern intel + intel-media-driver # LIBVA_DRIVER_NAME=iHD + libvdpau-va-gl # VDPAU_DRIVER=va_gl + #nvidia + nvidia-vaapi-driver # LIBVA_DRIVER_NAME=nvidia # this doesn't seem to work with mixed intel/nvidia + # VDPAU_DRIVER=nvidia + ]; + + services.hardware.bolt.enable = true; + + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; # latest/beta/production/stable + prime = { + # Sync and Offload cannot be enabled at the same time! + sync.enable = false; + offload.enable = true; + offload.enableOffloadCmd = true; + reverseSync.enable = false; + allowExternalGpu = false; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; }; + }; - boot.initrd.luks.devices."luksswap" = { - allowDiscards = true; - device = "/dev/disk/by-uuid/8d864adf-9a85-433f-8919-eb6a8371c077"; - }; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno2.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s20f0u1u4.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - - nix.settings.system-features = [ "gccarch-alderlake" ]; - nixpkgs.hostPlatform = { - #gcc.arch = "alderlake"; - #gcc.tune = "alderlake"; - system = "x86_64-linux"; - }; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - environment.systemPackages = with pkgs; [ - nvtopPackages.full - intel-gpu-tools - ]; - hardware.graphics.extraPackages = with pkgs; [ - # modern intel - intel-media-driver # LIBVA_DRIVER_NAME=iHD - libvdpau-va-gl # VDPAU_DRIVER=va_gl - #nvidia - nvidia-vaapi-driver # LIBVA_DRIVER_NAME=nvidia # this doesn't seem to work with mixed intel/nvidia - # VDPAU_DRIVER=nvidia - ]; - - services.hardware.bolt.enable = true; - - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; - open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; # latest/beta/production/stable - prime = { - # Sync and Offload cannot be enabled at the same time! - sync.enable = false; - offload.enable = true; - offload.enableOffloadCmd = true; - reverseSync.enable = false; - allowExternalGpu = false; - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; + environment.sessionVariables = { - environment.sessionVariables = { + #LIBVA_DRIVER_NAME = "iHD"; # default to intel hardware acceleration + #VDPAU_DRIVER = "va_gl"; # intel vdpau fallback + #__GL_GSYNC_ALLOWED = "1"; + #__GL_VRR_ALLOWED = "1"; + NVD_BACKEND = "direct"; # fixes nvidia VA-API hardware video acceleration - #LIBVA_DRIVER_NAME = "iHD"; # default to intel hardware acceleration - #VDPAU_DRIVER = "va_gl"; # intel vdpau fallback - #__GL_GSYNC_ALLOWED = "1"; - #__GL_VRR_ALLOWED = "1"; - NVD_BACKEND = "direct"; # fixes nvidia VA-API hardware video acceleration - - # Force NVIDIA offload for all applications - #__NV_PRIME_RENDER_OFFLOAD = "1"; - #__NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA_G0"; - #__GLX_VENDOR_LIBRARY_NAME = "nvidia"; - #__VK_LAYER_NV_optimus = "NVIDIA_only"; - }; + # Force NVIDIA offload for all applications + #__NV_PRIME_RENDER_OFFLOAD = "1"; + #__NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA_G0"; + #__GLX_VENDOR_LIBRARY_NAME = "nvidia"; + #__VK_LAYER_NV_optimus = "NVIDIA_only"; + }; - powerManagement.enable = true; - services.thermald.enable = true; # intel thermal protection + powerManagement.enable = true; + services.thermald.enable = true; # intel thermal protection } diff --git a/hosts/kaoru/os/lix.nix b/hosts/kaoru/os/lix.nix index 8ac561d..e70169f 100644 --- a/hosts/kaoru/os/lix.nix +++ b/hosts/kaoru/os/lix.nix @@ -1,20 +1,20 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - nixpkgs.overlays = [ - (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena - ; - }) - ]; - nix.package = pkgs.lixPackageSets.stable.lix; + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; + nix.package = pkgs.lixPackageSets.stable.lix; } diff --git a/hosts/kaoru/os/networkMounts.nix b/hosts/kaoru/os/networkMounts.nix index e7340a5..51d0034 100644 --- a/hosts/kaoru/os/networkMounts.nix +++ b/hosts/kaoru/os/networkMounts.nix @@ -1,60 +1,60 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - benisuzumeIP = "10.0.4.3"; - unasCIFS = addr: name: "//${addr}/${name}"; - unasNFS = addr: name: "${addr}:/var/nfs/shared/${name}"; + benisuzumeIP = "10.0.4.3"; + unasCIFS = addr: name: "//${addr}/${name}"; + unasNFS = addr: name: "${addr}:/var/nfs/shared/${name}"; - mntUnasCIFS = addr: name: { - fsType = "cifs"; - device = unasCIFS addr name; - options = [ - "credentials=${config.sops.secrets."benisuzume/cifs".path}" - "uid=${config.sidonia.userName}" - "gid=users" - "rw" - "exec" - "nofail" - "x-systemd.automount" - "x-systemd.device-timeout=60s" - "fsc" - ]; - }; + mntUnasCIFS = addr: name: { + fsType = "cifs"; + device = unasCIFS addr name; + options = [ + "credentials=${config.sops.secrets."benisuzume/cifs".path}" + "uid=${config.sidonia.userName}" + "gid=users" + "rw" + "exec" + "nofail" + "x-systemd.automount" + "x-systemd.device-timeout=60s" + "fsc" + ]; + }; - mntUnasNFS = addr: name: { - fsType = "nfs"; - device = unasNFS addr name; - options = [ - "hard" - "noacl" - "noatime" - "nodiratime" - "x-systemd.automount" - "x-systemd.device-timeout=60s" - "nofail" - "fsc" - ]; - }; + mntUnasNFS = addr: name: { + fsType = "nfs"; + device = unasNFS addr name; + options = [ + "hard" + "noacl" + "noatime" + "nodiratime" + "x-systemd.automount" + "x-systemd.device-timeout=60s" + "nofail" + "fsc" + ]; + }; - mntBenisuzumeCIFS = name: mntUnasCIFS benisuzumeIP name; - mntBenisuzumeNFS = name: mntUnasNFS benisuzumeIP name; + mntBenisuzumeCIFS = name: mntUnasCIFS benisuzumeIP name; + mntBenisuzumeNFS = name: mntUnasNFS benisuzumeIP name; in { - services.rpcbind.enable = true; - boot.supportedFilesystems = [ "nfs" ]; - environment.systemPackages = [ - pkgs.nfs-utils - pkgs.cifs-utils - ]; + services.rpcbind.enable = true; + boot.supportedFilesystems = [ "nfs" ]; + environment.systemPackages = [ + pkgs.nfs-utils + pkgs.cifs-utils + ]; - sops.secrets."benisuzume/cifs" = { }; + sops.secrets."benisuzume/cifs" = { }; - fileSystems."/mnt/benisuzume" = mntBenisuzumeCIFS "personal-drive"; + fileSystems."/mnt/benisuzume" = mntBenisuzumeCIFS "personal-drive"; - services.cachefilesd.enable = true; + services.cachefilesd.enable = true; } diff --git a/hosts/kaoru/os/virtualbox.nix b/hosts/kaoru/os/virtualbox.nix index 707c2aa..77f68d2 100644 --- a/hosts/kaoru/os/virtualbox.nix +++ b/hosts/kaoru/os/virtualbox.nix @@ -1,15 +1,15 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - virtualisation.virtualbox.host = { - enable = false; - enableExtensionPack = true; - enableKvm = true; - addNetworkInterface = false; - }; + virtualisation.virtualbox.host = { + enable = false; + enableExtensionPack = true; + enableKvm = true; + addNetworkInterface = false; + }; } diff --git a/hosts/shizuka/default.nix b/hosts/shizuka/default.nix index 8535686..bfc0aa6 100644 --- a/hosts/shizuka/default.nix +++ b/hosts/shizuka/default.nix @@ -1,63 +1,63 @@ { config, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ]; + imports = [ + ./hardware-configuration.nix + ]; - networking.hostName = "shizuka"; + networking.hostName = "shizuka"; - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "lavender"; - }; - sidonia = { - userName = "hoshijiro"; - ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGebQDOjFJrLRI/kxToxRVVYZo8GQWhYy/TW/dXoYcQn hoshijiro@shizuka"; - services.distributedBuilds.client.enable = false; - desktop.enable = true; - geolocation.enable = true; - text.comicCode.enable = true; - isLaptop = true; - }; + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "lavender"; + }; + sidonia = { + userName = "hoshijiro"; + ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGebQDOjFJrLRI/kxToxRVVYZo8GQWhYy/TW/dXoYcQn hoshijiro@shizuka"; + services.distributedBuilds.client.enable = false; + desktop.enable = true; + geolocation.enable = true; + text.comicCode.enable = true; + isLaptop = true; + }; - services.xserver.xkb.layout = "gb,us"; + services.xserver.xkb.layout = "gb,us"; - system.stateVersion = "25.05"; - programs.kdeconnect.enable = true; - home-manager.users.${config.sidonia.userName} = { - home.packages = [ - pkgs.pciutils - pkgs.mesa-demos + system.stateVersion = "25.05"; + programs.kdeconnect.enable = true; + home-manager.users.${config.sidonia.userName} = { + home.packages = [ + pkgs.pciutils + pkgs.mesa-demos + ]; + wayland.desktopManager.sidonia.keybinds = [ + { + name = "Bemenu (Discrete GPU)"; + mod = [ + "Super" + "Shift" ]; - wayland.desktopManager.sidonia.keybinds = [ + key = "O"; + exec = "DRI_PRIME=1 $(bemenu-run)"; + } + ]; + services.shikane = { + enable = true; + settings.profile = [ + { + name = "Undocked"; + output = [ { - name = "Bemenu (Discrete GPU)"; - mod = [ - "Super" - "Shift" - ]; - key = "O"; - exec = "DRI_PRIME=1 $(bemenu-run)"; + enable = true; + search = "n=eDP-1"; + scale = 1.0; + mode = "1920x1080@60.03"; + position = "0,0"; } - ]; - services.shikane = { - enable = true; - settings.profile = [ - { - name = "Undocked"; - output = [ - { - enable = true; - search = "n=eDP-1"; - scale = 1.0; - mode = "1920x1080@60.03"; - position = "0,0"; - } - ]; - } - ]; - }; + ]; + } + ]; }; + }; } diff --git a/hosts/shizuka/hardware-configuration.nix b/hosts/shizuka/hardware-configuration.nix index ad1dd80..1233404 100644 --- a/hosts/shizuka/hardware-configuration.nix +++ b/hosts/shizuka/hardware-configuration.nix @@ -1,74 +1,74 @@ { - config, - lib, - pkgs, - inputs, - ... + config, + lib, + pkgs, + inputs, + ... }: { - # Bootloader. - boot.loader.grub = { - enable = true; - device = "/dev/sda"; - useOSProber = true; - gfxmodeBios = "1920x1080,auto"; - gfxpayloadBios = "keep"; - configurationLimit = 20; - }; + # Bootloader. + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + useOSProber = true; + gfxmodeBios = "1920x1080,auto"; + gfxpayloadBios = "keep"; + configurationLimit = 20; + }; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ehci_pci" - "ahci" - "usb_storage" - "sd_mod" - "sr_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.blacklistedKernelModules = [ - #"ath3k" - #"btusb" - ]; - boot.kernelModules = [ - "kvm-intel" - "ntsync" - ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usb_storage" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.blacklistedKernelModules = [ + #"ath3k" + #"btusb" + ]; + boot.kernelModules = [ + "kvm-intel" + "ntsync" + ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.extraModulePackages = [ ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/c861c0fc-67f0-4f88-9ef2-d60ac7343ddf"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/c861c0fc-67f0-4f88-9ef2-d60ac7343ddf"; + fsType = "ext4"; + }; - swapDevices = [ - { device = "/dev/disk/by-uuid/189dd6aa-0066-4bc8-8598-534666eba59e"; } - { - device = "/var/lib/swapfile"; - size = 16*1024; # 16 Gib - } - ]; + swapDevices = [ + { device = "/dev/disk/by-uuid/189dd6aa-0066-4bc8-8598-534666eba59e"; } + { + device = "/var/lib/swapfile"; + size = 16 * 1024; # 16 Gib + } + ]; - networking.useDHCP = lib.mkDefault true; + networking.useDHCP = lib.mkDefault true; - hardware.graphics.extraPackages = [ - (pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }) - pkgs.libva-vdpau-driver - ]; + hardware.graphics.extraPackages = [ + (pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }) + pkgs.libva-vdpau-driver + ]; - hardware.bluetooth = { - powerOnBoot = true; - settings = { - General = { - Experimental = true; - FastConnectable = true; - }; - }; + hardware.bluetooth = { + powerOnBoot = true; + settings = { + General = { + Experimental = true; + FastConnectable = true; + }; }; + }; - nixpkgs.hostPlatform.system = "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nixpkgs.hostPlatform.system = "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } # echo 1 > /sys/bus/platform/drivers/ideapad_acpi/VPC2004\:00/fan_mode diff --git a/hosts/tsumugi/arr/default.nix b/hosts/tsumugi/arr/default.nix index f59637e..add44e5 100644 --- a/hosts/tsumugi/arr/default.nix +++ b/hosts/tsumugi/arr/default.nix @@ -1,71 +1,71 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - imports = [ - ./radarrMain.nix - ./radarrAnime.nix - ./sonarrAnime.nix - ./sonarrMain.nix - ]; + imports = [ + ./radarrMain.nix + ./radarrAnime.nix + ./sonarrAnime.nix + ./sonarrMain.nix + ]; - sops.secrets."tsumugi/autobrrSecret" = { }; + sops.secrets."tsumugi/autobrrSecret" = { }; - services.plex = { - enable = true; - openFirewall = true; - }; + services.plex = { + enable = true; + openFirewall = true; + }; - services.jellyfin = { - enable = false; - openFirewall = true; - cacheDir = "/mnt/media/data/appdata/jellyfin/cache"; - }; + services.jellyfin = { + enable = false; + openFirewall = true; + cacheDir = "/mnt/media/data/appdata/jellyfin/cache"; + }; - services.prowlarr = { - enable = true; - openFirewall = true; # 9696 - }; - services.bazarr = { - enable = true; - openFirewall = true; # 6767 - }; - services.seerr = { - enable = true; - port = 5055; - openFirewall = true; - }; + services.prowlarr = { + enable = true; + openFirewall = true; # 9696 + }; + services.bazarr = { + enable = true; + openFirewall = true; # 6767 + }; + services.seerr = { + enable = true; + port = 5055; + openFirewall = true; + }; - services.recyclarr = { - enable = true; - }; + services.recyclarr = { + enable = true; + }; - services.autobrr = { - enable = true; - openFirewall = true; # 7474 - secretFile = config.sops.secrets."tsumugi/autobrrSecret".path; - settings = { - host = "10.0.4.2"; - port = 7474; - }; + services.autobrr = { + enable = true; + openFirewall = true; # 7474 + secretFile = config.sops.secrets."tsumugi/autobrrSecret".path; + settings = { + host = "10.0.4.2"; + port = 7474; }; + }; - networking = { - nat = - let - wildcard = if config.networking.nftables.enable then "*" else "+"; - in - { - enable = true; - enableIPv6 = true; - internalInterfaces = [ ("ve-" + wildcard) ]; - externalInterface = "enp6s0"; - }; - #networkmanager.unmanaged = [ "interface-name:ve-*" ]; - }; + networking = { + nat = + let + wildcard = if config.networking.nftables.enable then "*" else "+"; + in + { + enable = true; + enableIPv6 = true; + internalInterfaces = [ ("ve-" + wildcard) ]; + externalInterface = "enp6s0"; + }; + #networkmanager.unmanaged = [ "interface-name:ve-*" ]; + }; } diff --git a/hosts/tsumugi/arr/mkPortRemap.nix b/hosts/tsumugi/arr/mkPortRemap.nix index fe43556..37556c1 100644 --- a/hosts/tsumugi/arr/mkPortRemap.nix +++ b/hosts/tsumugi/arr/mkPortRemap.nix @@ -1,38 +1,38 @@ { - config, - lib, + config, + lib, }: { - portRemap = configuration: { - autoStart = true; - privateNetwork = true; - hostAddress = "192.168.${builtins.toString configuration.id}.10"; - localAddress = "192.168.${builtins.toString configuration.id}.11"; - hostAddress6 = "fc00::${builtins.toString configuration.id}:10"; - localAddress6 = "fc00::${builtins.toString configuration.id}:11"; - forwardPorts = [ - { - containerPort = configuration.containerPort; - hostPort = configuration.hostPort; - protocol = "tcp"; - } - ]; - bindMounts."/mnt/media" = { - mountPoint = "/mnt/media"; - hostPath = "/mnt/media"; - isReadOnly = false; - }; - config = { - system = {inherit (config.system) stateVersion;}; - networking = { - firewall.enable = true; - useHostResolvConf = lib.mkForce false; - nameservers = [ - "10.0.4.1" - "2001:bb6:9540:502::1" - ]; - }; - } - // configuration.config; + portRemap = configuration: { + autoStart = true; + privateNetwork = true; + hostAddress = "192.168.${builtins.toString configuration.id}.10"; + localAddress = "192.168.${builtins.toString configuration.id}.11"; + hostAddress6 = "fc00::${builtins.toString configuration.id}:10"; + localAddress6 = "fc00::${builtins.toString configuration.id}:11"; + forwardPorts = [ + { + containerPort = configuration.containerPort; + hostPort = configuration.hostPort; + protocol = "tcp"; + } + ]; + bindMounts."/mnt/media" = { + mountPoint = "/mnt/media"; + hostPath = "/mnt/media"; + isReadOnly = false; }; + config = { + system = { inherit (config.system) stateVersion; }; + networking = { + firewall.enable = true; + useHostResolvConf = lib.mkForce false; + nameservers = [ + "10.0.4.1" + "2001:bb6:9540:502::1" + ]; + }; + } + // configuration.config; + }; } diff --git a/hosts/tsumugi/arr/mkRecyclarrScore.nix b/hosts/tsumugi/arr/mkRecyclarrScore.nix index 871ff08..a95cda3 100644 --- a/hosts/tsumugi/arr/mkRecyclarrScore.nix +++ b/hosts/tsumugi/arr/mkRecyclarrScore.nix @@ -1,16 +1,16 @@ profileName: let - mkScorer = profile: ids: score: { - trash_ids = ids; - assign_scores_to = [ - { - name = profile; - score = score; - } - ]; - }; + mkScorer = profile: ids: score: { + trash_ids = ids; + assign_scores_to = [ + { + name = profile; + score = score; + } + ]; + }; in rec { - mkScores = mkScorer profileName; - mkScore = id: (mkScores [ id ]); + mkScores = mkScorer profileName; + mkScore = id: (mkScores [ id ]); } diff --git a/hosts/tsumugi/arr/radarrAnime.nix b/hosts/tsumugi/arr/radarrAnime.nix index c283eb1..9d19352 100644 --- a/hosts/tsumugi/arr/radarrAnime.nix +++ b/hosts/tsumugi/arr/radarrAnime.nix @@ -1,152 +1,152 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - profileName = "1080p Anime Movie"; - inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; - inherit ((import ./mkPortRemap.nix) {inherit config lib;}) portRemap; + profileName = "1080p Anime Movie"; + inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; + inherit ((import ./mkPortRemap.nix) { inherit config lib; }) portRemap; in { - networking.firewall.allowedTCPPorts = [ 7887 ]; + networking.firewall.allowedTCPPorts = [ 7887 ]; - containers.radarrAnime = portRemap { - id = 2; - containerPort = 7878; - hostPort = 7887; - config = { - services.radarr = { - enable = true; - openFirewall = true; - }; - }; + containers.radarrAnime = portRemap { + id = 2; + containerPort = 7878; + hostPort = 7887; + config = { + services.radarr = { + enable = true; + openFirewall = true; + }; }; + }; - sops.secrets."tsumugi/radarrAnimeApiKey" = { }; + sops.secrets."tsumugi/radarrAnimeApiKey" = { }; - systemd.services.recyclarr.serviceConfig.LoadCredential = [ - "radarrAnimeApiKey:${config.sops.secrets."tsumugi/radarrAnimeApiKey".path}" - ]; + systemd.services.recyclarr.serviceConfig.LoadCredential = [ + "radarrAnimeApiKey:${config.sops.secrets."tsumugi/radarrAnimeApiKey".path}" + ]; - services.recyclarr.configuration.radarr.radarrAnime = { - base_url = "http://10.0.4.2:7887"; - api_key._secret = "/run/credentials/recyclarr.service/radarrAnimeApiKey"; - delete_old_custom_formats = true; - replace_existing_custom_formats = true; - quality_definition.type = "anime"; - quality_profiles = [ - { - name = profileName; - reset_unmatched_scores.enabled = true; - min_format_score = 0; - upgrade = { - allowed = true; - until_quality = "Remux-1080p"; - until_score = 10000; - }; - qualities = [ - { - name = "Remux-1080p"; - qualities = [ - "Remux-1080p" - "Bluray-1080p" - ]; - } - { - name = "1080p"; - qualities = [ - "WEBRip-1080p" - "WEBDL-1080p" - "HDTV-1080p" - ]; - } - { name = "Bluray-720p"; } - { - name = "720p"; - qualities = [ - "WEBRip-720p" - "WEBDL-720p" - "HDTV-720p" - ]; - } - { name = "Bluray-576p"; } - { name = "Bluray-480p"; } - { - name = "480p"; - qualities = [ - "WEBRip-480p" - "WEBDL-480p" - ]; - } - { - name = "LQ"; - enabled = false; - qualities = [ - "Remux-2160p" - "Bluray-2160p" - "WEBRip-2160p" - "WEBDL-2160p" - "HDTV-2160p" - "DVD-R" - "DVD" - "SDTV" - "DVDSCR" - "REGIONAL" - "TELECINE" - "TELESYNC" - "CAM" - "WORKPRINT" - "Unknown" - "BR-DISK" - "Raw-HD" - ]; - } - ]; - } - ]; - custom_formats = [ - (mkScore "4a3b087eea2ce012fcc1ce319259a3be" 2000) # Anime Dual Audio - (mkScore "fb3ccc5d5cc8f77c9055d4cb4561dded" 1400) # Anime BD Tier 01 (Top SeaDex Muxers) - (mkScore "66926c8fa9312bc74ab71bf69aae4f4a" 1300) # Anime BD Tier 02 (SeaDex Muxers) - (mkScore "fa857662bad28d5ff21a6e611869a0ff" 1200) # Anime BD Tier 03 (SeaDex Muxers) - (mkScore "f262f1299d99b1a2263375e8fa2ddbb3" 1100) # Anime BD Tier 04 (SeaDex Muxers) - (mkScore "3a3ff47579026e76d6504ebea39390de" 1050) # Remux Tier 01 - (mkScore "ca864ed93c7b431150cc6748dc34875d" 1000) # Anime BD Tier 05 (Remuxes) - (mkScore "9f98181fe5a3fbeb0cc29340da2a468a" 1000) # Remux Tier 02 - (mkScore "8baaf0b3142bf4d94c42a724f034e27a" 950) # Remux Tier 03 - (mkScore "9dce189b960fddf47891b7484ee886ca" 900) # Anime BD Tier 06 (FanSubs) - (mkScore "1ef101b3a82646b40e0cab7fc92cd896" 800) # Anime BD Tier 07 (P2P/Scene) - (mkScore "6115ccd6640b978234cc47f2c1f2cadc" 700) # Anime BD Tier 08 (Mini Encodes) - (mkScore "8167cffba4febfb9a6988ef24f274e7e" 600) # Anime Web Tier 01 (Muxers) - (mkScore "8526c54e36b4962d340fce52ef030e76" 500) # Anime Web Tier 02 (Top FanSubs) - (mkScore "de41e72708d2c856fa261094c85e965d" 400) # Anime Web Tier 03 (Official Subs) - (mkScore "c20f169ef63c5f40c2def54abaf4438e" 350) # WEB Tier 01 - (mkScore "9edaeee9ea3bcd585da9b7c0ac3fc54f" 300) # Anime Web Tier 04 (Official Subs) - (mkScore "403816d65392c79236dcb6dd591aeda4" 250) # WEB Tier 02 - (mkScore "22d953bbe897857b517928f3652b8dd3" 200) # Anime Web Tier 05 (FanSubs) - (mkScore "af94e0fe497124d1f9ce732069ec8c3b" 150) # WEB Tier 03 - (mkScore "064af5f084a0a24458cc8ecd3220f93f" 101) # Uncensored - (mkScore "a786fbc0eae05afe3bb51aee3c83a9d4" 100) # Anime Web Tier 06 (FanSubs) - (mkScore "60f6d50cbd3cfc3e9a8c00e3a30c3114" 10) # VRV - (mkScore "d4e5e842fad129a3c097bdb2d20d31a0" 4) # v4 - (mkScore "db92c27ba606996b146b57fbe6d09186" 3) # v3 - (mkScore "3df5e6dfef4b09bb6002f732bed5b774" 2) # v2 - (mkScore "5f400539421b8fcf71d51e6384434573" 1) # v1 - (mkScores [ - "a5d148168c4506b55cf53984107c396e" # 10bit - "cae4ca30163749b891686f95532519bd" # AV1 - ] 0) - (mkScore "c259005cbaeb5ab44c06eddb4751e70c" (-51)) # v0 - (mkScores [ - "b0fdc5897f68c9a68c70c25169f77447" # Anime LQ Groups - "06b6542a47037d1e33b15aa3677c2365" # Anime Raws - "b23eae459cc960816f2d6ba84af45055" # Dubs Only - "9172b2f683f6223e3a1846427b417a3d" # VOSTFR - ] (-10000)) + services.recyclarr.configuration.radarr.radarrAnime = { + base_url = "http://10.0.4.2:7887"; + api_key._secret = "/run/credentials/recyclarr.service/radarrAnimeApiKey"; + delete_old_custom_formats = true; + replace_existing_custom_formats = true; + quality_definition.type = "anime"; + quality_profiles = [ + { + name = profileName; + reset_unmatched_scores.enabled = true; + min_format_score = 0; + upgrade = { + allowed = true; + until_quality = "Remux-1080p"; + until_score = 10000; + }; + qualities = [ + { + name = "Remux-1080p"; + qualities = [ + "Remux-1080p" + "Bluray-1080p" + ]; + } + { + name = "1080p"; + qualities = [ + "WEBRip-1080p" + "WEBDL-1080p" + "HDTV-1080p" + ]; + } + { name = "Bluray-720p"; } + { + name = "720p"; + qualities = [ + "WEBRip-720p" + "WEBDL-720p" + "HDTV-720p" + ]; + } + { name = "Bluray-576p"; } + { name = "Bluray-480p"; } + { + name = "480p"; + qualities = [ + "WEBRip-480p" + "WEBDL-480p" + ]; + } + { + name = "LQ"; + enabled = false; + qualities = [ + "Remux-2160p" + "Bluray-2160p" + "WEBRip-2160p" + "WEBDL-2160p" + "HDTV-2160p" + "DVD-R" + "DVD" + "SDTV" + "DVDSCR" + "REGIONAL" + "TELECINE" + "TELESYNC" + "CAM" + "WORKPRINT" + "Unknown" + "BR-DISK" + "Raw-HD" + ]; + } ]; - }; + } + ]; + custom_formats = [ + (mkScore "4a3b087eea2ce012fcc1ce319259a3be" 2000) # Anime Dual Audio + (mkScore "fb3ccc5d5cc8f77c9055d4cb4561dded" 1400) # Anime BD Tier 01 (Top SeaDex Muxers) + (mkScore "66926c8fa9312bc74ab71bf69aae4f4a" 1300) # Anime BD Tier 02 (SeaDex Muxers) + (mkScore "fa857662bad28d5ff21a6e611869a0ff" 1200) # Anime BD Tier 03 (SeaDex Muxers) + (mkScore "f262f1299d99b1a2263375e8fa2ddbb3" 1100) # Anime BD Tier 04 (SeaDex Muxers) + (mkScore "3a3ff47579026e76d6504ebea39390de" 1050) # Remux Tier 01 + (mkScore "ca864ed93c7b431150cc6748dc34875d" 1000) # Anime BD Tier 05 (Remuxes) + (mkScore "9f98181fe5a3fbeb0cc29340da2a468a" 1000) # Remux Tier 02 + (mkScore "8baaf0b3142bf4d94c42a724f034e27a" 950) # Remux Tier 03 + (mkScore "9dce189b960fddf47891b7484ee886ca" 900) # Anime BD Tier 06 (FanSubs) + (mkScore "1ef101b3a82646b40e0cab7fc92cd896" 800) # Anime BD Tier 07 (P2P/Scene) + (mkScore "6115ccd6640b978234cc47f2c1f2cadc" 700) # Anime BD Tier 08 (Mini Encodes) + (mkScore "8167cffba4febfb9a6988ef24f274e7e" 600) # Anime Web Tier 01 (Muxers) + (mkScore "8526c54e36b4962d340fce52ef030e76" 500) # Anime Web Tier 02 (Top FanSubs) + (mkScore "de41e72708d2c856fa261094c85e965d" 400) # Anime Web Tier 03 (Official Subs) + (mkScore "c20f169ef63c5f40c2def54abaf4438e" 350) # WEB Tier 01 + (mkScore "9edaeee9ea3bcd585da9b7c0ac3fc54f" 300) # Anime Web Tier 04 (Official Subs) + (mkScore "403816d65392c79236dcb6dd591aeda4" 250) # WEB Tier 02 + (mkScore "22d953bbe897857b517928f3652b8dd3" 200) # Anime Web Tier 05 (FanSubs) + (mkScore "af94e0fe497124d1f9ce732069ec8c3b" 150) # WEB Tier 03 + (mkScore "064af5f084a0a24458cc8ecd3220f93f" 101) # Uncensored + (mkScore "a786fbc0eae05afe3bb51aee3c83a9d4" 100) # Anime Web Tier 06 (FanSubs) + (mkScore "60f6d50cbd3cfc3e9a8c00e3a30c3114" 10) # VRV + (mkScore "d4e5e842fad129a3c097bdb2d20d31a0" 4) # v4 + (mkScore "db92c27ba606996b146b57fbe6d09186" 3) # v3 + (mkScore "3df5e6dfef4b09bb6002f732bed5b774" 2) # v2 + (mkScore "5f400539421b8fcf71d51e6384434573" 1) # v1 + (mkScores [ + "a5d148168c4506b55cf53984107c396e" # 10bit + "cae4ca30163749b891686f95532519bd" # AV1 + ] 0) + (mkScore "c259005cbaeb5ab44c06eddb4751e70c" (-51)) # v0 + (mkScores [ + "b0fdc5897f68c9a68c70c25169f77447" # Anime LQ Groups + "06b6542a47037d1e33b15aa3677c2365" # Anime Raws + "b23eae459cc960816f2d6ba84af45055" # Dubs Only + "9172b2f683f6223e3a1846427b417a3d" # VOSTFR + ] (-10000)) + ]; + }; } diff --git a/hosts/tsumugi/arr/radarrMain.nix b/hosts/tsumugi/arr/radarrMain.nix index 9feb4ab..682d54f 100644 --- a/hosts/tsumugi/arr/radarrMain.nix +++ b/hosts/tsumugi/arr/radarrMain.nix @@ -1,200 +1,200 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - profileName = "4k Movie"; - inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; + profileName = "4k Movie"; + inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; in { - services.radarr = { - enable = true; - openFirewall = true; # 7878 - }; + services.radarr = { + enable = true; + openFirewall = true; # 7878 + }; - sops.secrets."tsumugi/radarrMainApiKey" = { }; + sops.secrets."tsumugi/radarrMainApiKey" = { }; - systemd.services.recyclarr.serviceConfig.LoadCredential = [ - "radarrMainApiKey:${config.sops.secrets."tsumugi/radarrMainApiKey".path}" - ]; + systemd.services.recyclarr.serviceConfig.LoadCredential = [ + "radarrMainApiKey:${config.sops.secrets."tsumugi/radarrMainApiKey".path}" + ]; - services.recyclarr.configuration.radarr.radarrMain = { - base_url = "http://localhost:7878"; - api_key._secret = "/run/credentials/recyclarr.service/radarrMainApiKey"; - delete_old_custom_formats = true; - replace_existing_custom_formats = true; - quality_definition.type = "movie"; - quality_profiles = [ - { - name = profileName; - reset_unmatched_scores.enabled = true; - min_format_score = 0; - upgrade = { - allowed = true; - until_quality = "Remux-2160p"; - until_score = 10000; - }; - qualities = [ - { name = "Remux-2160p"; } - { - name = "2160p"; - qualities = [ - "Bluray-2160p" - "WEBRip-2160p" - "WEBDL-2160p" - "HDTV-2160p" - ]; - } - { name = "Remux-1080p"; } - { - name = "1080p"; - qualities = [ - "Bluray-1080p" - "WEBRip-1080p" - "WEBDL-1080p" - "HDTV-1080p" - ]; - } - { - name = "720p"; - qualities = [ - "Bluray-720p" - "WEBRip-720p" - "WEBDL-720p" - "HDTV-720p" - ]; - } - { - name = "LQ"; - enabled = false; - qualities = [ - "Bluray-576p" - "Bluray-480p" - "WEBRip-480p" - "WEBDL-480p" - "DVD-R" - "DVD" - "SDTV" - "DVDSCR" - "REGIONAL" - "TELECINE" - "TELESYNC" - "CAM" - "WORKPRINT" - "Unknown" - "BR-DISK" - "Raw-HD" - ]; - } - ]; - } + services.recyclarr.configuration.radarr.radarrMain = { + base_url = "http://localhost:7878"; + api_key._secret = "/run/credentials/recyclarr.service/radarrMainApiKey"; + delete_old_custom_formats = true; + replace_existing_custom_formats = true; + quality_definition.type = "movie"; + quality_profiles = [ + { + name = profileName; + reset_unmatched_scores.enabled = true; + min_format_score = 0; + upgrade = { + allowed = true; + until_quality = "Remux-2160p"; + until_score = 10000; + }; + qualities = [ + { name = "Remux-2160p"; } + { + name = "2160p"; + qualities = [ + "Bluray-2160p" + "WEBRip-2160p" + "WEBDL-2160p" + "HDTV-2160p" + ]; + } + { name = "Remux-1080p"; } + { + name = "1080p"; + qualities = [ + "Bluray-1080p" + "WEBRip-1080p" + "WEBDL-1080p" + "HDTV-1080p" + ]; + } + { + name = "720p"; + qualities = [ + "Bluray-720p" + "WEBRip-720p" + "WEBDL-720p" + "HDTV-720p" + ]; + } + { + name = "LQ"; + enabled = false; + qualities = [ + "Bluray-576p" + "Bluray-480p" + "WEBRip-480p" + "WEBDL-480p" + "DVD-R" + "DVD" + "SDTV" + "DVDSCR" + "REGIONAL" + "TELECINE" + "TELESYNC" + "CAM" + "WORKPRINT" + "Unknown" + "BR-DISK" + "Raw-HD" + ]; + } ]; - custom_formats = [ - (mkScore "496f355514737f7d83bf7aa4d24f8169" 5000) # TrueHD ATMOS - (mkScore "2f22d89048b01681dde8afe203bf2e95" 4500) # DTS X - (mkScores [ - "417804f7f2c4308c1f4c5d380d4c4475" # ATMOS (undefined) - "1af239278386be2919e1bcee0bde047e" # DD+ ATMOS - ] 3000) - (mkScore "3cafb66171b47f226146a0770576870f" 2750) # TrueHD - (mkScore "dcf3ec6938fa32445f590a4da84256cd" 2500) # DTS-HD MA - (mkScores [ - "a570d4a0e56a2874b64e5bfa55202a1b" # FLAC - "e7c2fcae07cbada050a0af3357491d7b" # PCM - ] 2250) - (mkScore "8e109e50e0a0b83a5098b056e13bf6db" 2000) # DTS-HD HRA - (mkScore "3a3ff47579026e76d6504ebea39390de" 1950) # Remux Tier 01 - (mkScore "9f98181fe5a3fbeb0cc29340da2a468a" 1900) # Remux Tier 02 - (mkScore "8baaf0b3142bf4d94c42a724f034e27a" 1850) # Remux Tier 03 - (mkScores [ - "4d74ac4c4db0b64bff6ce0cffef99bf0" # UHD Bluray Tier 01 - "ed27ebfef2f323e964fb1f61391bcb35" # HD Bluray Tier 01 - ] 1800) - (mkScores [ - "a58f517a70193f8e578056642178419d" # UHD Bluray Tier 02 - "c20c8647f2746a1f4c4262b0fbbeeeae" # HD Bluray Tier 02 - "185f1dd7264c4562b9022d963ac37424" # DD+ - ] 1750) - (mkScores [ - "e71939fae578037e7aed3ee219bbe7c1" # UHD Bluray Tier 03 - "5608c71bcebba0a5e666223bae8c9227" # HD Bluray Tier 03 - "c20f169ef63c5f40c2def54abaf4438e" # WEB Tier 01 - ] 1700) - (mkScore "403816d65392c79236dcb6dd591aeda4" 1650) # WEB Tier 02 - (mkScore "af94e0fe497124d1f9ce732069ec8c3b" 1600) # WEB Tier 03 - (mkScore "f9f847ac70a0af62ea4a08280b859636" 1500) # DTS-ES - (mkScore "1c1a4c5e823891c75bc50380a6866f73" 1250) # DTS - (mkScores [ - "240770601cc226190c367ef59aba7463" # AAC - "b337d6812e06c200ec9a2d3cfa9d20a7" # DV Boost - ] 1000) - (mkScores [ - "eecf3a857724171f968a66cb5719e152" # IMAX - "9f6cbff8cfe4ebbc1bde14c7b7bec0de" # IMAX Enhanced - ] 800) - (mkScore "c2998bd0d90ed5621d8df281e839436e" 750) # DD + } + ]; + custom_formats = [ + (mkScore "496f355514737f7d83bf7aa4d24f8169" 5000) # TrueHD ATMOS + (mkScore "2f22d89048b01681dde8afe203bf2e95" 4500) # DTS X + (mkScores [ + "417804f7f2c4308c1f4c5d380d4c4475" # ATMOS (undefined) + "1af239278386be2919e1bcee0bde047e" # DD+ ATMOS + ] 3000) + (mkScore "3cafb66171b47f226146a0770576870f" 2750) # TrueHD + (mkScore "dcf3ec6938fa32445f590a4da84256cd" 2500) # DTS-HD MA + (mkScores [ + "a570d4a0e56a2874b64e5bfa55202a1b" # FLAC + "e7c2fcae07cbada050a0af3357491d7b" # PCM + ] 2250) + (mkScore "8e109e50e0a0b83a5098b056e13bf6db" 2000) # DTS-HD HRA + (mkScore "3a3ff47579026e76d6504ebea39390de" 1950) # Remux Tier 01 + (mkScore "9f98181fe5a3fbeb0cc29340da2a468a" 1900) # Remux Tier 02 + (mkScore "8baaf0b3142bf4d94c42a724f034e27a" 1850) # Remux Tier 03 + (mkScores [ + "4d74ac4c4db0b64bff6ce0cffef99bf0" # UHD Bluray Tier 01 + "ed27ebfef2f323e964fb1f61391bcb35" # HD Bluray Tier 01 + ] 1800) + (mkScores [ + "a58f517a70193f8e578056642178419d" # UHD Bluray Tier 02 + "c20c8647f2746a1f4c4262b0fbbeeeae" # HD Bluray Tier 02 + "185f1dd7264c4562b9022d963ac37424" # DD+ + ] 1750) + (mkScores [ + "e71939fae578037e7aed3ee219bbe7c1" # UHD Bluray Tier 03 + "5608c71bcebba0a5e666223bae8c9227" # HD Bluray Tier 03 + "c20f169ef63c5f40c2def54abaf4438e" # WEB Tier 01 + ] 1700) + (mkScore "403816d65392c79236dcb6dd591aeda4" 1650) # WEB Tier 02 + (mkScore "af94e0fe497124d1f9ce732069ec8c3b" 1600) # WEB Tier 03 + (mkScore "f9f847ac70a0af62ea4a08280b859636" 1500) # DTS-ES + (mkScore "1c1a4c5e823891c75bc50380a6866f73" 1250) # DTS + (mkScores [ + "240770601cc226190c367ef59aba7463" # AAC + "b337d6812e06c200ec9a2d3cfa9d20a7" # DV Boost + ] 1000) + (mkScores [ + "eecf3a857724171f968a66cb5719e152" # IMAX + "9f6cbff8cfe4ebbc1bde14c7b7bec0de" # IMAX Enhanced + ] 800) + (mkScore "c2998bd0d90ed5621d8df281e839436e" 750) # DD - (mkScore "493b6d1dbec3c3364c59d7607f7e3405" 500) # HDR - (mkScore "957d0f44b592285f26449575e8b1167e" 125) # Special Edition - (mkScores [ - "caa37d0df9c348912df1fb1d88f9273a" # HDR10+ Boost - "0f12c086e289cf966fa5948eac571f44" # Hybrid - ] 100) - (mkScores [ - "eca37840c13c6ef2dd0262b141a5482f" # 4k Remaster - "e0c07d59beb37348e975a930d5e50319" # Criterion Collection - "9d27d9d2181838f76dee150882bdc58c" # Masters of Cinema - "570bc9ebecd92723d2d21500f4be314c" # Remaster - "db9b4c4b53d312a3ca5f1378f6440fc9" # Vinegar Syndrome - ] 25) - (mkScores [ - "16622a6911d1ab5d5b8b713d5b0036d4" # CRiT - "2a6039655313bf5dab1e43523b62c374" # MA - ] 20) - (mkScore "cc5e51a9e85a6296ceefe097a77f12f4" 15) # BCORE - (mkScore "5caaaa1c08c1742aa4342d8c4cc463f2" 7) # Repack3 - (mkScore "ae43b294509409a6a13919dedd4764c4" 6) # Repack2 - (mkScore "e7718d7a3ce595f289bfee26adc178f5" 5) # Repack / Proper - (mkScores [ - "b3b3a6ac74ecbd56bcdbefa4799fb9df" # AMZN - "40e9380490e748672c2522eaaeb692f7" # ATVP - "cae4ca30163749b891686f95532519bd" # AV1 - "84272245b2988854bfb76a16e60baea5" # DSNP - "509e5f41146e278f9eab1ddaceb34515" # HBO - "5763d1b0ce84aff3b21038eea8e9b8ad" # HMAX - "526d445d4c16214309f0fd2b3be18a89" # Hulu - "e0ec9672be6cac914ffad34a6b077209" # iT - "6a061313d22e51e0f25b7cd4dc065233" # MAX - "170b1d363bd8516fbf3a3eb05d4faff6" # NF - "c9fd353f8f5f1baf56dc601c4cb29920" # PCOK - "e36a0ba1bc902b26ee40818a1d59b8bd" # PMTP - "c2863d2a50c9acad1fb50e53ece60817" # STAN - "dc98083864ea246d05a42df0d05f81cc" # x265 (HD) - "839bea857ed2c0a8e084f3cbdbd65ecb" # x265 (no HDR/DV) - "ae9b7c9ebde1f3bd336a8cbd1ec4c5e5" # No-RlsGroup - ] 0) - (mkScores [ - "7357cf5161efbf8c4d5d0c30b4815ee2" # Obfuscated - "5c44f52a8714fdd79bb4d98e2673be1f" # Retags - ] (-10)) - (mkScores [ - "b8cd450cbfa689c0259a01d9e29ba3d6" # 3D - "b6832f586342ef70d9c128d40c07b872" # Bad Dual Groups - "ed38b889b31be83fda192888e2286d83" # BR-DISK - "e6886871085226c3da1830830146846c" # Generated Dynamic HDR - "712d74cd88bceb883ee32f773656b1f5" # Sing-Along Versions - "0a3f082873eb454bde444150b70253cc" # Extras - "90a6f9a284dff5103f6346090e6280c8" # LQ - "e204b80c87be9497a8a6eaff48f72905" # LQ (Release Title) - "25c12f78430a3a23413652cbd1d48d77" # SDR (no WEBDL) - "bfd8eb01832d646a0a89c4deb46f8564" # Upscaled - "923b6abef9b17f937fab56cfcf89e1f1" # DV (w/o HDR fallback) - ] (-10000)) - ]; - }; + (mkScore "493b6d1dbec3c3364c59d7607f7e3405" 500) # HDR + (mkScore "957d0f44b592285f26449575e8b1167e" 125) # Special Edition + (mkScores [ + "caa37d0df9c348912df1fb1d88f9273a" # HDR10+ Boost + "0f12c086e289cf966fa5948eac571f44" # Hybrid + ] 100) + (mkScores [ + "eca37840c13c6ef2dd0262b141a5482f" # 4k Remaster + "e0c07d59beb37348e975a930d5e50319" # Criterion Collection + "9d27d9d2181838f76dee150882bdc58c" # Masters of Cinema + "570bc9ebecd92723d2d21500f4be314c" # Remaster + "db9b4c4b53d312a3ca5f1378f6440fc9" # Vinegar Syndrome + ] 25) + (mkScores [ + "16622a6911d1ab5d5b8b713d5b0036d4" # CRiT + "2a6039655313bf5dab1e43523b62c374" # MA + ] 20) + (mkScore "cc5e51a9e85a6296ceefe097a77f12f4" 15) # BCORE + (mkScore "5caaaa1c08c1742aa4342d8c4cc463f2" 7) # Repack3 + (mkScore "ae43b294509409a6a13919dedd4764c4" 6) # Repack2 + (mkScore "e7718d7a3ce595f289bfee26adc178f5" 5) # Repack / Proper + (mkScores [ + "b3b3a6ac74ecbd56bcdbefa4799fb9df" # AMZN + "40e9380490e748672c2522eaaeb692f7" # ATVP + "cae4ca30163749b891686f95532519bd" # AV1 + "84272245b2988854bfb76a16e60baea5" # DSNP + "509e5f41146e278f9eab1ddaceb34515" # HBO + "5763d1b0ce84aff3b21038eea8e9b8ad" # HMAX + "526d445d4c16214309f0fd2b3be18a89" # Hulu + "e0ec9672be6cac914ffad34a6b077209" # iT + "6a061313d22e51e0f25b7cd4dc065233" # MAX + "170b1d363bd8516fbf3a3eb05d4faff6" # NF + "c9fd353f8f5f1baf56dc601c4cb29920" # PCOK + "e36a0ba1bc902b26ee40818a1d59b8bd" # PMTP + "c2863d2a50c9acad1fb50e53ece60817" # STAN + "dc98083864ea246d05a42df0d05f81cc" # x265 (HD) + "839bea857ed2c0a8e084f3cbdbd65ecb" # x265 (no HDR/DV) + "ae9b7c9ebde1f3bd336a8cbd1ec4c5e5" # No-RlsGroup + ] 0) + (mkScores [ + "7357cf5161efbf8c4d5d0c30b4815ee2" # Obfuscated + "5c44f52a8714fdd79bb4d98e2673be1f" # Retags + ] (-10)) + (mkScores [ + "b8cd450cbfa689c0259a01d9e29ba3d6" # 3D + "b6832f586342ef70d9c128d40c07b872" # Bad Dual Groups + "ed38b889b31be83fda192888e2286d83" # BR-DISK + "e6886871085226c3da1830830146846c" # Generated Dynamic HDR + "712d74cd88bceb883ee32f773656b1f5" # Sing-Along Versions + "0a3f082873eb454bde444150b70253cc" # Extras + "90a6f9a284dff5103f6346090e6280c8" # LQ + "e204b80c87be9497a8a6eaff48f72905" # LQ (Release Title) + "25c12f78430a3a23413652cbd1d48d77" # SDR (no WEBDL) + "bfd8eb01832d646a0a89c4deb46f8564" # Upscaled + "923b6abef9b17f937fab56cfcf89e1f1" # DV (w/o HDR fallback) + ] (-10000)) + ]; + }; } diff --git a/hosts/tsumugi/arr/sonarrAnime.nix b/hosts/tsumugi/arr/sonarrAnime.nix index 5e1ae4a..ea1ba11 100644 --- a/hosts/tsumugi/arr/sonarrAnime.nix +++ b/hosts/tsumugi/arr/sonarrAnime.nix @@ -1,163 +1,163 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - profileName = "1080p Anime"; - inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; - inherit ((import ./mkPortRemap.nix) { inherit config lib; }) portRemap; + profileName = "1080p Anime"; + inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; + inherit ((import ./mkPortRemap.nix) { inherit config lib; }) portRemap; in { - networking.firewall.allowedTCPPorts = [ 8998 ]; + networking.firewall.allowedTCPPorts = [ 8998 ]; - containers.sonarrAnime = portRemap { - id = 1; - containerPort = 8989; - hostPort = 8998; - config = { - services.sonarr = { - enable = true; - openFirewall = true; - }; - }; + containers.sonarrAnime = portRemap { + id = 1; + containerPort = 8989; + hostPort = 8998; + config = { + services.sonarr = { + enable = true; + openFirewall = true; + }; }; + }; - sops.secrets."tsumugi/sonarrAnimeApiKey" = { }; + sops.secrets."tsumugi/sonarrAnimeApiKey" = { }; - systemd.services.recyclarr.serviceConfig.LoadCredential = [ - "sonarrAnimeApiKey:${config.sops.secrets."tsumugi/sonarrAnimeApiKey".path}" - ]; + systemd.services.recyclarr.serviceConfig.LoadCredential = [ + "sonarrAnimeApiKey:${config.sops.secrets."tsumugi/sonarrAnimeApiKey".path}" + ]; - services.recyclarr.configuration.sonarr.sonarrAnime = { - base_url = "http://10.0.4.2:8998"; - api_key._secret = "/run/credentials/recyclarr.service/sonarrAnimeApiKey"; - delete_old_custom_formats = true; - replace_existing_custom_formats = true; - quality_definition.type = "anime"; - quality_profiles = [ - { - name = profileName; - reset_unmatched_scores.enabled = true; - min_format_score = 0; - upgrade = { - allowed = true; - until_quality = "Bluray-1080p"; - until_score = 10000; - }; - qualities = [ - { - name = "Bluray-1080p"; - qualities = [ - "Bluray-1080p Remux" - "Bluray-1080p" - ]; - } - { - name = "1080p"; - qualities = [ - "WEBRip-1080p" - "WEBDL-1080p" - "HDTV-1080p" - ]; - } - { name = "Bluray-720p"; } - { - name = "720p"; - qualities = [ - "WEBRip-720p" - "WEBDL-720p" - "HDTV-720p" - ]; - } - { name = "Bluray-576p"; } - { name = "Bluray-480p"; } - { - name = "480p"; - qualities = [ - "WEBRip-480p" - "WEBDL-480p" - ]; - } - { name = "DVD"; } - { name = "SDTV"; } - { - name = "LQ"; - enabled = false; - qualities = [ - "Bluray-2160p Remux" - "Bluray-2160p" - "WEBRip-2160p" - "WEBDL-2160p" - "HDTV-2160p" - "Unknown" - "Raw-HD" - ]; - } - ]; - } - ]; - custom_formats = [ - (mkScore "418f50b10f1907201b6cfdf881f467b7" 2000) # Anime Dual Audio - (mkScore "949c16fe0a8147f50ba82cc2df9411c9" 1400) # Anime BD Tier 01 (Top SeaDex Muxers) - (mkScore "ed7f1e315e000aef424a58517fa48727" 1300) # Anime BD Tier 02 (SeaDex Muxers) - (mkScore "096e406c92baa713da4a72d88030b815" 1200) # Anime BD Tier 03 (SeaDex Muxers) - (mkScore "30feba9da3030c5ed1e0f7d610bcadc4" 1100) # Anime BD Tier 04 (SeaDex Muxers) - (mkScore "9965a052eb87b0d10313b1cea89eb451" 1050) # Remux Tier 01 - (mkScore "545a76b14ddc349b8b185a6344e28b04" 1000) # Anime BD Tier 05 (Remuxes) - (mkScore "8a1d0c3d7497e741736761a1da866a2e" 1000) # Remux Tier 02 - (mkScore "25d2afecab632b1582eaf03b63055f72" 900) # Anime BD Tier 06 (FanSubs) - (mkScore "0329044e3d9137b08502a9f84a7e58db" 800) # Anime BD Tier 07 (P2P/Scene) - (mkScore "c81bbfb47fed3d5a3ad027d077f889de" 700) # Anime BD Tier 08 (Mini Encodes) - (mkScore "e0014372773c8f0e1bef8824f00c7dc4" 600) # Anime Web Tier 01 (Muxers) - (mkScore "19180499de5ef2b84b6ec59aae444696" 500) # Anime Web Tier 02 (Top FanSubs) - (mkScore "c27f2ae6a4e82373b0f1da094e2489ad" 400) # Anime Web Tier 03 (Official Subs) - (mkScore "e6258996055b9fbab7e9cb2f75819294" 350) # WEB Tier 01 - (mkScore "4fd5528a3a8024e6b49f9c67053ea5f3" 300) # Anime Web Tier 04 (Official Subs) - (mkScore "29c2a13d091144f63307e4a8ce963a39" 200) # Anime Web Tier 05 (FanSubs) - (mkScores [ - "58790d4e2fdcd9733aa7ae68ba2bb503" # WEB Tier 02 - "d84935abd3f8556dcd51d4f27e22d0a6" # WEB Tier 03 - ] 150) - (mkScore "026d5aadd1a6b4e550b134cb6c72b3ca" 101) # Uncensored - (mkScore "dc262f88d74c651b12e9d90b39f6c753" 100) # Anime Web Tier 06 (FanSubs) - (mkScore "3e0b26604165f463f3e8e192261e7284" 6) # CR - (mkScore "89358767a60cc28783cdc3d0be9388a4" 5) # DSNP - (mkScores [ - "4fc15eeb8f2f9a749f918217d4234ad8" # v4 - "d34870697c9db575f17700212167be23" # NF - ] 4) - (mkScores [ - "0e5833d3af2cc5fa96a0c29cd4477feb" # v3 - "d660701077794679fd59e8bdf4ce3a29" # AMZN - "44a8ee6403071dd7b8a3a8dd3fe8cb20" # VRV - ] 3) - (mkScores [ - "228b8ee9aa0a609463efca874524a6b8" # v2 - "1284d18e693de8efe0fe7d6b3e0b9170" # FUNi - ] 2) - (mkScores [ - "273bd326df95955e1b6c26527d1df89b" # v1 - "a370d974bc7b80374de1d9ba7519760b" # ABEMA - "d54cd2bf1326287275b56bccedb72ee2" # ADN - ] 1) - (mkScores [ - "b2550eb333d27b75833e25b8c2557b38" # 10bit - "15a05bc7c1a36e2b57fd628f8977e2fc" # AV1 - "7dd31f3dee6d2ef8eeaa156e23c3857e" # B-Global - "4c67ff059210182b59cdd41697b8cb08" # Bilibili - "570b03b3145a25011bf073274a407259" # HIDIVE - ] 0) - (mkScore "d2d7b8a9d39413da5f44054080e028a3" (-51)) # v0 - (mkScores [ - "e3515e519f3b1360cbfc17651944354c" # Anime LQ Groups - "b4a1b3d705159cdca36d71e57ca86871" # Anime Raws - "9c14d194486c4014d422adc64092d794" # Dubs Only - "07a32f77690263bb9fda1842db7e273f" # VOSTFR - ] (-10000)) + services.recyclarr.configuration.sonarr.sonarrAnime = { + base_url = "http://10.0.4.2:8998"; + api_key._secret = "/run/credentials/recyclarr.service/sonarrAnimeApiKey"; + delete_old_custom_formats = true; + replace_existing_custom_formats = true; + quality_definition.type = "anime"; + quality_profiles = [ + { + name = profileName; + reset_unmatched_scores.enabled = true; + min_format_score = 0; + upgrade = { + allowed = true; + until_quality = "Bluray-1080p"; + until_score = 10000; + }; + qualities = [ + { + name = "Bluray-1080p"; + qualities = [ + "Bluray-1080p Remux" + "Bluray-1080p" + ]; + } + { + name = "1080p"; + qualities = [ + "WEBRip-1080p" + "WEBDL-1080p" + "HDTV-1080p" + ]; + } + { name = "Bluray-720p"; } + { + name = "720p"; + qualities = [ + "WEBRip-720p" + "WEBDL-720p" + "HDTV-720p" + ]; + } + { name = "Bluray-576p"; } + { name = "Bluray-480p"; } + { + name = "480p"; + qualities = [ + "WEBRip-480p" + "WEBDL-480p" + ]; + } + { name = "DVD"; } + { name = "SDTV"; } + { + name = "LQ"; + enabled = false; + qualities = [ + "Bluray-2160p Remux" + "Bluray-2160p" + "WEBRip-2160p" + "WEBDL-2160p" + "HDTV-2160p" + "Unknown" + "Raw-HD" + ]; + } ]; - }; + } + ]; + custom_formats = [ + (mkScore "418f50b10f1907201b6cfdf881f467b7" 2000) # Anime Dual Audio + (mkScore "949c16fe0a8147f50ba82cc2df9411c9" 1400) # Anime BD Tier 01 (Top SeaDex Muxers) + (mkScore "ed7f1e315e000aef424a58517fa48727" 1300) # Anime BD Tier 02 (SeaDex Muxers) + (mkScore "096e406c92baa713da4a72d88030b815" 1200) # Anime BD Tier 03 (SeaDex Muxers) + (mkScore "30feba9da3030c5ed1e0f7d610bcadc4" 1100) # Anime BD Tier 04 (SeaDex Muxers) + (mkScore "9965a052eb87b0d10313b1cea89eb451" 1050) # Remux Tier 01 + (mkScore "545a76b14ddc349b8b185a6344e28b04" 1000) # Anime BD Tier 05 (Remuxes) + (mkScore "8a1d0c3d7497e741736761a1da866a2e" 1000) # Remux Tier 02 + (mkScore "25d2afecab632b1582eaf03b63055f72" 900) # Anime BD Tier 06 (FanSubs) + (mkScore "0329044e3d9137b08502a9f84a7e58db" 800) # Anime BD Tier 07 (P2P/Scene) + (mkScore "c81bbfb47fed3d5a3ad027d077f889de" 700) # Anime BD Tier 08 (Mini Encodes) + (mkScore "e0014372773c8f0e1bef8824f00c7dc4" 600) # Anime Web Tier 01 (Muxers) + (mkScore "19180499de5ef2b84b6ec59aae444696" 500) # Anime Web Tier 02 (Top FanSubs) + (mkScore "c27f2ae6a4e82373b0f1da094e2489ad" 400) # Anime Web Tier 03 (Official Subs) + (mkScore "e6258996055b9fbab7e9cb2f75819294" 350) # WEB Tier 01 + (mkScore "4fd5528a3a8024e6b49f9c67053ea5f3" 300) # Anime Web Tier 04 (Official Subs) + (mkScore "29c2a13d091144f63307e4a8ce963a39" 200) # Anime Web Tier 05 (FanSubs) + (mkScores [ + "58790d4e2fdcd9733aa7ae68ba2bb503" # WEB Tier 02 + "d84935abd3f8556dcd51d4f27e22d0a6" # WEB Tier 03 + ] 150) + (mkScore "026d5aadd1a6b4e550b134cb6c72b3ca" 101) # Uncensored + (mkScore "dc262f88d74c651b12e9d90b39f6c753" 100) # Anime Web Tier 06 (FanSubs) + (mkScore "3e0b26604165f463f3e8e192261e7284" 6) # CR + (mkScore "89358767a60cc28783cdc3d0be9388a4" 5) # DSNP + (mkScores [ + "4fc15eeb8f2f9a749f918217d4234ad8" # v4 + "d34870697c9db575f17700212167be23" # NF + ] 4) + (mkScores [ + "0e5833d3af2cc5fa96a0c29cd4477feb" # v3 + "d660701077794679fd59e8bdf4ce3a29" # AMZN + "44a8ee6403071dd7b8a3a8dd3fe8cb20" # VRV + ] 3) + (mkScores [ + "228b8ee9aa0a609463efca874524a6b8" # v2 + "1284d18e693de8efe0fe7d6b3e0b9170" # FUNi + ] 2) + (mkScores [ + "273bd326df95955e1b6c26527d1df89b" # v1 + "a370d974bc7b80374de1d9ba7519760b" # ABEMA + "d54cd2bf1326287275b56bccedb72ee2" # ADN + ] 1) + (mkScores [ + "b2550eb333d27b75833e25b8c2557b38" # 10bit + "15a05bc7c1a36e2b57fd628f8977e2fc" # AV1 + "7dd31f3dee6d2ef8eeaa156e23c3857e" # B-Global + "4c67ff059210182b59cdd41697b8cb08" # Bilibili + "570b03b3145a25011bf073274a407259" # HIDIVE + ] 0) + (mkScore "d2d7b8a9d39413da5f44054080e028a3" (-51)) # v0 + (mkScores [ + "e3515e519f3b1360cbfc17651944354c" # Anime LQ Groups + "b4a1b3d705159cdca36d71e57ca86871" # Anime Raws + "9c14d194486c4014d422adc64092d794" # Dubs Only + "07a32f77690263bb9fda1842db7e273f" # VOSTFR + ] (-10000)) + ]; + }; } diff --git a/hosts/tsumugi/arr/sonarrMain.nix b/hosts/tsumugi/arr/sonarrMain.nix index 31f8ad0..581dd46 100644 --- a/hosts/tsumugi/arr/sonarrMain.nix +++ b/hosts/tsumugi/arr/sonarrMain.nix @@ -1,150 +1,150 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - profileName = "4k TV"; - inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; + profileName = "4k TV"; + inherit ((import ./mkRecyclarrScore.nix) profileName) mkScores mkScore; in { - services.sonarr = { - enable = true; - openFirewall = true; # 8989 - }; + services.sonarr = { + enable = true; + openFirewall = true; # 8989 + }; - sops.secrets."tsumugi/sonarrMainApiKey" = { }; + sops.secrets."tsumugi/sonarrMainApiKey" = { }; - systemd.services.recyclarr.serviceConfig.LoadCredential = [ - "sonarrMainApiKey:${config.sops.secrets."tsumugi/sonarrMainApiKey".path}" - ]; + systemd.services.recyclarr.serviceConfig.LoadCredential = [ + "sonarrMainApiKey:${config.sops.secrets."tsumugi/sonarrMainApiKey".path}" + ]; - services.recyclarr.configuration.sonarr.sonarrMain = { - base_url = "http://localhost:8989"; - api_key._secret = "/run/credentials/recyclarr.service/sonarrMainApiKey"; - delete_old_custom_formats = true; - replace_existing_custom_formats = true; - quality_definition.type = "series"; - quality_profiles = [ - { - name = profileName; - reset_unmatched_scores.enabled = true; - min_format_score = 0; - upgrade = { - allowed = true; - until_quality = "Bluray-2160p Remux"; - until_score = 10000; - }; - qualities = [ - { name = "Bluray-2160p Remux"; } - { - name = "2160p"; - qualities = [ - "WEBDL-2160p" - "WEBRip-2160p" - "Bluray-2160p" - "HDTV-2160p" - ]; - } - { name = "Bluray-1080p Remux"; } - { - name = "1080p"; - qualities = [ - "Bluray-1080p" - "WEBRip-1080p" - "WEBDL-1080p" - "HDTV-1080p" - ]; - } - { - name = "720p"; - qualities = [ - "Bluray-720p" - "WEBRip-720p" - "WEBDL-720p" - "HDTV-720p" - ]; - } - { name = "Bluray-576p"; } - { - name = "Disc-480p"; - qualities = [ - "Bluray-480p" - "DVD" - ]; - } - { - name = "WEB-480p"; - qualities = [ - "WEBRip-480p" - "WEBDL-480p" - ]; - } - { - name = "LQ"; - enabled = false; - qualities = [ - "SDTV" - "Unknown" - "Raw-HD" - ]; - } - ]; - } - ]; - custom_formats = [ - (mkScore "e6258996055b9fbab7e9cb2f75819294" 1700) # WEB Tier 01 - (mkScore "58790d4e2fdcd9733aa7ae68ba2bb503" 1650) # WEB Tier 02 - (mkScore "d0c516558625b04b363fa6c5c2c7cfd4" 1600) # WEB Scene - (mkScore "d84935abd3f8556dcd51d4f27e22d0a6" 1600) # WEB Tier 03 - (mkScore "7c3a61a9c6cb04f52f1544be6d44a026" 1000) # DV Boost - (mkScore "505d871304820ba7106b693be6fe4a9e" 500) # HDR - (mkScore "0c4b99df9206d2cfac3c05ab897dd62a" 100) # HDR10+ Boost - (mkScore "f67c9ca88f463a48346062e8ad07713f" 100) # ATVP - (mkScore "89358767a60cc28783cdc3d0be9388a4" 100) # DSNP - (mkScore "81d1fbf600e2540cee87f3a23f9d3c1c" 90) # MAX - (mkScore "a880d6abc21e7c16884f3ae393f84179" 80) # HMAX - (mkScore "d9e511921c8cedc7282e291b0209cdc5" 50) # ATV - (mkScore "da393fd4e2c0cce7c9dc2669c43e0593" 50) # ROKU - (mkScore "d660701077794679fd59e8bdf4ce3a29" 70) # AMZN - (mkScore "d34870697c9db575f17700212167be23" 60) # NF - (mkScore "1656adc6d7bb2c8cca6acfb6592db421" 60) # PCOK - (mkScore "c67a75ae4a1715f2bb4d492755ba4195" 60) # PMTP - (mkScore "1efe8da11bfd74fbbcd4d8117ddb9213" 60) # STAN - (mkScore "77a7b25585c18af08f60b1547bb9b4fb" 50) # CC - (mkScore "36b72f59f4ea20aad9316f475f2d9fbb" 50) # DCU - (mkScore "7a235133c87f7da4c8cccceca7e3c7a6" 50) # HBO - (mkScore "f6cce30f1733d5c8194222a7507909bb" 50) # Hulu - (mkScore "0ac24a2a68a9700bcb7eeca8e5cd644c" 50) # iT - (mkScore "ae58039e1319178e6be73caab5c42166" 50) # SHO - (mkScore "9623c5c9cac8e939c1b9aedd32f640bf" 50) # SYFY - (mkScore "43b3cf48cb385cd3eac608ee6bca7f09" 20) # UHD Streaming Boost - (mkScore "44e7c4de10ae50265753082e5dc76047" 7) # Repack v3 - (mkScore "eb3d5cc0a2be0db205fb823640db6a3c" 6) # Repack v2 - (mkScore "ec8fa7296b64e8cd390a1600981f3923" 5) # Repack/Proper - (mkScores [ - "15a05bc7c1a36e2b57fd628f8977e2fc" # AV1 - "47435ece6b99a0b477caf360e79ba0bb" # x265 (HD) - "9b64dff695c2115facf1b6ea59c9bd07" # x265 (no HDR/DV) - "82d40da2bc6923f41e14394075dd4b03" # No-RlsGroup - ] 0) - (mkScores [ - "e1a997ddb54e3ecbfe06341ad323c458" # Obfuscated - "06d66ab109d4d2eddb2794d21526d140" # Retags - ] (-10)) - (mkScores [ - "32b367365729d530ca1c124a0b180c64" # Bad Dual Groups - "85c61753df5da1fb2aab6f2a47426b09" # BR-DISK - "fbcb31d8dabd2a319072b84fc0b7249c" # Extras - "9c11cd3f07101cdba90a2d81cf0e56b4" # LQ - "e2315f990da2e2cbfc9fa5b7a6fcfe48" # LQ (Release Title) - "83304f261cf516bb208c18c54c0adf97" # SDR (no WEBDL) - "9b27ab6498ec0f31a3353992e19434ca" # DV (w/o HDR fallback) - ] (-10000)) + services.recyclarr.configuration.sonarr.sonarrMain = { + base_url = "http://localhost:8989"; + api_key._secret = "/run/credentials/recyclarr.service/sonarrMainApiKey"; + delete_old_custom_formats = true; + replace_existing_custom_formats = true; + quality_definition.type = "series"; + quality_profiles = [ + { + name = profileName; + reset_unmatched_scores.enabled = true; + min_format_score = 0; + upgrade = { + allowed = true; + until_quality = "Bluray-2160p Remux"; + until_score = 10000; + }; + qualities = [ + { name = "Bluray-2160p Remux"; } + { + name = "2160p"; + qualities = [ + "WEBDL-2160p" + "WEBRip-2160p" + "Bluray-2160p" + "HDTV-2160p" + ]; + } + { name = "Bluray-1080p Remux"; } + { + name = "1080p"; + qualities = [ + "Bluray-1080p" + "WEBRip-1080p" + "WEBDL-1080p" + "HDTV-1080p" + ]; + } + { + name = "720p"; + qualities = [ + "Bluray-720p" + "WEBRip-720p" + "WEBDL-720p" + "HDTV-720p" + ]; + } + { name = "Bluray-576p"; } + { + name = "Disc-480p"; + qualities = [ + "Bluray-480p" + "DVD" + ]; + } + { + name = "WEB-480p"; + qualities = [ + "WEBRip-480p" + "WEBDL-480p" + ]; + } + { + name = "LQ"; + enabled = false; + qualities = [ + "SDTV" + "Unknown" + "Raw-HD" + ]; + } ]; - }; + } + ]; + custom_formats = [ + (mkScore "e6258996055b9fbab7e9cb2f75819294" 1700) # WEB Tier 01 + (mkScore "58790d4e2fdcd9733aa7ae68ba2bb503" 1650) # WEB Tier 02 + (mkScore "d0c516558625b04b363fa6c5c2c7cfd4" 1600) # WEB Scene + (mkScore "d84935abd3f8556dcd51d4f27e22d0a6" 1600) # WEB Tier 03 + (mkScore "7c3a61a9c6cb04f52f1544be6d44a026" 1000) # DV Boost + (mkScore "505d871304820ba7106b693be6fe4a9e" 500) # HDR + (mkScore "0c4b99df9206d2cfac3c05ab897dd62a" 100) # HDR10+ Boost + (mkScore "f67c9ca88f463a48346062e8ad07713f" 100) # ATVP + (mkScore "89358767a60cc28783cdc3d0be9388a4" 100) # DSNP + (mkScore "81d1fbf600e2540cee87f3a23f9d3c1c" 90) # MAX + (mkScore "a880d6abc21e7c16884f3ae393f84179" 80) # HMAX + (mkScore "d9e511921c8cedc7282e291b0209cdc5" 50) # ATV + (mkScore "da393fd4e2c0cce7c9dc2669c43e0593" 50) # ROKU + (mkScore "d660701077794679fd59e8bdf4ce3a29" 70) # AMZN + (mkScore "d34870697c9db575f17700212167be23" 60) # NF + (mkScore "1656adc6d7bb2c8cca6acfb6592db421" 60) # PCOK + (mkScore "c67a75ae4a1715f2bb4d492755ba4195" 60) # PMTP + (mkScore "1efe8da11bfd74fbbcd4d8117ddb9213" 60) # STAN + (mkScore "77a7b25585c18af08f60b1547bb9b4fb" 50) # CC + (mkScore "36b72f59f4ea20aad9316f475f2d9fbb" 50) # DCU + (mkScore "7a235133c87f7da4c8cccceca7e3c7a6" 50) # HBO + (mkScore "f6cce30f1733d5c8194222a7507909bb" 50) # Hulu + (mkScore "0ac24a2a68a9700bcb7eeca8e5cd644c" 50) # iT + (mkScore "ae58039e1319178e6be73caab5c42166" 50) # SHO + (mkScore "9623c5c9cac8e939c1b9aedd32f640bf" 50) # SYFY + (mkScore "43b3cf48cb385cd3eac608ee6bca7f09" 20) # UHD Streaming Boost + (mkScore "44e7c4de10ae50265753082e5dc76047" 7) # Repack v3 + (mkScore "eb3d5cc0a2be0db205fb823640db6a3c" 6) # Repack v2 + (mkScore "ec8fa7296b64e8cd390a1600981f3923" 5) # Repack/Proper + (mkScores [ + "15a05bc7c1a36e2b57fd628f8977e2fc" # AV1 + "47435ece6b99a0b477caf360e79ba0bb" # x265 (HD) + "9b64dff695c2115facf1b6ea59c9bd07" # x265 (no HDR/DV) + "82d40da2bc6923f41e14394075dd4b03" # No-RlsGroup + ] 0) + (mkScores [ + "e1a997ddb54e3ecbfe06341ad323c458" # Obfuscated + "06d66ab109d4d2eddb2794d21526d140" # Retags + ] (-10)) + (mkScores [ + "32b367365729d530ca1c124a0b180c64" # Bad Dual Groups + "85c61753df5da1fb2aab6f2a47426b09" # BR-DISK + "fbcb31d8dabd2a319072b84fc0b7249c" # Extras + "9c11cd3f07101cdba90a2d81cf0e56b4" # LQ + "e2315f990da2e2cbfc9fa5b7a6fcfe48" # LQ (Release Title) + "83304f261cf516bb208c18c54c0adf97" # SDR (no WEBDL) + "9b27ab6498ec0f31a3353992e19434ca" # DV (w/o HDR fallback) + ] (-10000)) + ]; + }; } diff --git a/hosts/tsumugi/default.nix b/hosts/tsumugi/default.nix index e4520a4..55fa718 100644 --- a/hosts/tsumugi/default.nix +++ b/hosts/tsumugi/default.nix @@ -1,51 +1,51 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./hardware-configuration.nix - ./arr - ./gameServers - ./transmission.nix - ./iperf.nix - ./networkMounts.nix - ./openssh.nix - ./reverseProxy.nix - ]; - networking.hostName = "tsumugi"; - nix.settings = { - keep-outputs = true; - keep-derivations = true; - }; - catppuccin = { + imports = [ + ./hardware-configuration.nix + ./arr + ./gameServers + ./transmission.nix + ./iperf.nix + ./networkMounts.nix + ./openssh.nix + ./reverseProxy.nix + ]; + networking.hostName = "tsumugi"; + nix.settings = { + keep-outputs = true; + keep-derivations = true; + }; + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "teal"; + }; + system.stateVersion = "24.05"; + sidonia = { + userName = "shiraui"; + services.distributedBuilds = { + host = { enable = true; - flavor = "mocha"; - accent = "teal"; - }; - system.stateVersion = "24.05"; - sidonia = { - userName = "shiraui"; - services.distributedBuilds = { - host = { - enable = true; - signing.pubKey = "tsumugi:uwel3yZCdN+VwrqZHk+sPD3HtyhgbLISCqUxVnY1uAI="; - signing.privKeyPath = config.sops.secrets."tsumugi/cacheKey.pem".path; - ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBidxqGI8eFmemPDR2FAGpApxR4tXgSD6m893JchS2+"; - hostNames = [ - "10.0.4.2" - "tsumugi.local" - ]; - }; - }; - }; - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age.keyFile = "/home/shiraui/.config/sops/age/keys.txt"; - secrets."tsumugi/cacheKey.pem" = { }; + signing.pubKey = "tsumugi:uwel3yZCdN+VwrqZHk+sPD3HtyhgbLISCqUxVnY1uAI="; + signing.privKeyPath = config.sops.secrets."tsumugi/cacheKey.pem".path; + ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBidxqGI8eFmemPDR2FAGpApxR4tXgSD6m893JchS2+"; + hostNames = [ + "10.0.4.2" + "tsumugi.local" + ]; + }; }; + }; + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/shiraui/.config/sops/age/keys.txt"; + secrets."tsumugi/cacheKey.pem" = { }; + }; } diff --git a/hosts/tsumugi/gameServers/cobblemon.nix b/hosts/tsumugi/gameServers/cobblemon.nix index 1195aa0..c61ea14 100644 --- a/hosts/tsumugi/gameServers/cobblemon.nix +++ b/hosts/tsumugi/gameServers/cobblemon.nix @@ -1,177 +1,177 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - # https://leixb.fly.dev/blog/modrinth-modpacks-nix - # fetchzip doesn't let us fix the file permissions after extracting... (no read permissions :/) - modpack = pkgs.stdenvNoCC.mkDerivation { - name = "cobblemon-modpack"; - dontConfigure = true; - src = pkgs.fetchurl { - name = "cobblemon.zip"; - url = "https://cdn.modrinth.com/data/5FFgwNNP/versions/98odLiu9/Cobblemon%20Official%20%5BFabric%5D%201.6.1.4.mrpack"; - hash = "sha256-xABBCrPpCJL+YwO1pvX4lbYzxFwGkzvduXX08vhCpnU="; - }; - nativeBuildInputs = [ pkgs.unzip ]; - postUnpack = '' - chmod -R +r * - find . -type d -exec chmod +x {} \; - ''; - installPhase = '' - ls -la ../ - mkdir $out - cp -R ../ $out/ - ''; + # https://leixb.fly.dev/blog/modrinth-modpacks-nix + # fetchzip doesn't let us fix the file permissions after extracting... (no read permissions :/) + modpack = pkgs.stdenvNoCC.mkDerivation { + name = "cobblemon-modpack"; + dontConfigure = true; + src = pkgs.fetchurl { + name = "cobblemon.zip"; + url = "https://cdn.modrinth.com/data/5FFgwNNP/versions/98odLiu9/Cobblemon%20Official%20%5BFabric%5D%201.6.1.4.mrpack"; + hash = "sha256-xABBCrPpCJL+YwO1pvX4lbYzxFwGkzvduXX08vhCpnU="; }; + nativeBuildInputs = [ pkgs.unzip ]; + postUnpack = '' + chmod -R +r * + find . -type d -exec chmod +x {} \; + ''; + installPhase = '' + ls -la ../ + mkdir $out + cp -R ../ $out/ + ''; + }; - mkMod = - name: mod: - pkgs.runCommand name { } '' - mkdir -p $out/mods - cp ${mod} $out/mods - ''; + mkMod = + name: mod: + pkgs.runCommand name { } '' + mkdir -p $out/mods + cp ${mod} $out/mods + ''; - extra_mods = [ - (mkMod "Cobblemon Unchained" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/wh0wnzrT/versions/loS5XVHf/unchained-fabric-1.6.1-1.5.2.jar"; - hash = "sha256-qVJUC+FVKLVprxJrdJwN520BY2M5zvbh+kdW2vXo+zo="; - } - )) - (mkMod "Tim Core" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/lVP9aUaY/versions/NsLwACmT/timcore-fabric-1.6.1-1.15.3.jar"; - hash = "sha256-N56Z9vZGT97poLC1mql+v8Y9PtPOZ4tnG8I2F69R0/U="; - } - )) - (mkMod "Cobblemon Counter" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/rj8uLYP4/versions/ReIkCnf8/counter-fabric-1.6.1-1.6.1.jar"; - hash = "sha256-mUHnMvsPkxlIembW8D2sUnTLq3F3M7SZ9hevbEJpmYg="; - } - )) - (mkMod "Cobblemon Pasture Collector" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/AufMZTuI/versions/H6cULxOp/cobblemon-pasturecollector-1.6-fabric-1.3.0.jar"; - hash = "sha256-7Z0W+68B2E3mnf/vfSqc1mCz5dtp8yizHktTyTWo6fQ="; - } - )) - (mkMod "Cobblemon Drop Loot Tables" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/8EoIMfd7/versions/TPq9hUyK/cobblemon-droploottables-1.6-fabric-1.4.1.jar"; - hash = "sha256-MO46gbHRHnbiAxRKiyEp6yi+xrKnx7Il7z2iY2Ivizw="; - } - )) - (mkMod "Fabric Language Kotlin" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/Ha28R6CL/versions/LcgnDDmT/fabric-language-kotlin-1.13.7%2Bkotlin.2.2.21.jar"; - hash = "sha256-d5UZY+3V19N+5PF0431GqHHkW5c0JvO0nWclyBm0uPI="; - } - )) - (mkMod "MobsBeGone" ( - pkgs.fetchurl { - url = "https://cdn.modrinth.com/data/hXvXSxxg/versions/B5tawRRL/MobsBeGone-0.0.7.jar"; - hash = "sha256-rUXJwb/owBjTcvn7brPpVQfWJStstCBEeNBGU9ljTpg="; - } - )) - ]; + extra_mods = [ + (mkMod "Cobblemon Unchained" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/wh0wnzrT/versions/loS5XVHf/unchained-fabric-1.6.1-1.5.2.jar"; + hash = "sha256-qVJUC+FVKLVprxJrdJwN520BY2M5zvbh+kdW2vXo+zo="; + } + )) + (mkMod "Tim Core" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/lVP9aUaY/versions/NsLwACmT/timcore-fabric-1.6.1-1.15.3.jar"; + hash = "sha256-N56Z9vZGT97poLC1mql+v8Y9PtPOZ4tnG8I2F69R0/U="; + } + )) + (mkMod "Cobblemon Counter" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/rj8uLYP4/versions/ReIkCnf8/counter-fabric-1.6.1-1.6.1.jar"; + hash = "sha256-mUHnMvsPkxlIembW8D2sUnTLq3F3M7SZ9hevbEJpmYg="; + } + )) + (mkMod "Cobblemon Pasture Collector" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/AufMZTuI/versions/H6cULxOp/cobblemon-pasturecollector-1.6-fabric-1.3.0.jar"; + hash = "sha256-7Z0W+68B2E3mnf/vfSqc1mCz5dtp8yizHktTyTWo6fQ="; + } + )) + (mkMod "Cobblemon Drop Loot Tables" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/8EoIMfd7/versions/TPq9hUyK/cobblemon-droploottables-1.6-fabric-1.4.1.jar"; + hash = "sha256-MO46gbHRHnbiAxRKiyEp6yi+xrKnx7Il7z2iY2Ivizw="; + } + )) + (mkMod "Fabric Language Kotlin" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/Ha28R6CL/versions/LcgnDDmT/fabric-language-kotlin-1.13.7%2Bkotlin.2.2.21.jar"; + hash = "sha256-d5UZY+3V19N+5PF0431GqHHkW5c0JvO0nWclyBm0uPI="; + } + )) + (mkMod "MobsBeGone" ( + pkgs.fetchurl { + url = "https://cdn.modrinth.com/data/hXvXSxxg/versions/B5tawRRL/MobsBeGone-0.0.7.jar"; + hash = "sha256-rUXJwb/owBjTcvn7brPpVQfWJStstCBEeNBGU9ljTpg="; + } + )) + ]; - cobblemonFiles = - let - modrinthIndex = builtins.fromJSON (builtins.readFile "${modpack}/modrinth.index.json"); + cobblemonFiles = + let + modrinthIndex = builtins.fromJSON (builtins.readFile "${modpack}/modrinth.index.json"); - files = builtins.filter ( - file: !(file ? env) || file.env.server != "unsupported" - ) modrinthIndex.files; + files = builtins.filter ( + file: !(file ? env) || file.env.server != "unsupported" + ) modrinthIndex.files; - downloads = builtins.map ( - file: - pkgs.fetchurl { - urls = file.downloads; - inherit (file.hashes) sha512; - } - ) files; + downloads = builtins.map ( + file: + pkgs.fetchurl { + urls = file.downloads; + inherit (file.hashes) sha512; + } + ) files; - paths = builtins.map (builtins.getAttr "path") files; + paths = builtins.map (builtins.getAttr "path") files; - derivations = lib.zipListsWith ( - path: download: - let - folderName = builtins.match "(.*)/(.*$)" path; - folder = builtins.head folderName; - name = builtins.head (builtins.tail folderName); - in - pkgs.runCommand name { } '' - mkdir -p "$out/${folder}" - cp ${download} "$out/${path}" - '' - ) paths downloads; + derivations = lib.zipListsWith ( + path: download: + let + folderName = builtins.match "(.*)/(.*$)" path; + folder = builtins.head folderName; + name = builtins.head (builtins.tail folderName); in - pkgs.symlinkJoin { - inherit (modrinthIndex) name; - paths = derivations ++ [ "${modpack}/overrides" ] ++ extra_mods; - }; + pkgs.runCommand name { } '' + mkdir -p "$out/${folder}" + cp ${download} "$out/${path}" + '' + ) paths downloads; + in + pkgs.symlinkJoin { + inherit (modrinthIndex) name; + paths = derivations ++ [ "${modpack}/overrides" ] ++ extra_mods; + }; in { - services.minecraft-servers.servers.cobblemon = { - enable = true; - autoStart = true; - openFirewall = true; - package = pkgs.fabricServers.fabric-1_21_1; - serverProperties = { - enable-rcon = false; - enforce-whitelist = true; - white-list = true; - server-port = 25566; - network-compression-threshold = 64; - difficulty = "normal"; - level-seed = "6662878079737881253"; - }; - symlinks = lib.genAttrs [ - "mods" - "icon.png" - "instance.png" - ] (name: "${cobblemonFiles}/${name}"); - files = - let - confFiles = lib.filesystem.listFilesRecursive "${cobblemonFiles}/config"; - in - builtins.listToAttrs ( - builtins.map (value: { - name = builtins.unsafeDiscardStringContext (lib.strings.removePrefix "${cobblemonFiles}/" value); - inherit value; - }) confFiles - ); - - jvmOpts = lib.concatStringsSep " " [ - "-Xmx8G" - "-Xms8G" - "-XX:+AlwaysPreTouch" - "-XX:+DisableExplicitGC" - "-XX:+ParallelRefProcEnabled" - "-XX:+PerfDisableSharedMem" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+UseG1GC" - "-XX:G1HeapRegionSize=16M" - "-XX:G1HeapWastePercent=5" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1MixedGCCountTarget=4" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1NewSizePercent=40" - "-XX:G1RSetUpdatingPauseTimePercent=5" - "-XX:G1ReservePercent=15" - "-XX:InitiatingHeapOccupancyPercent=20" - "-XX:MaxGCPauseMillis=200" - "-XX:MaxTenuringThreshold=1" - "-XX:SurvivorRatio=32" - "-Dusing.aikars.flags=https://mcflags.emc.gs" - "-Daikars.new.flags=true" - "-Djava.net.preferIPv4Stack=true" - "-Djava.net.preferIPv6Addresses=false" - ]; + services.minecraft-servers.servers.cobblemon = { + enable = true; + autoStart = true; + openFirewall = true; + package = pkgs.fabricServers.fabric-1_21_1; + serverProperties = { + enable-rcon = false; + enforce-whitelist = true; + white-list = true; + server-port = 25566; + network-compression-threshold = 64; + difficulty = "normal"; + level-seed = "6662878079737881253"; }; + symlinks = lib.genAttrs [ + "mods" + "icon.png" + "instance.png" + ] (name: "${cobblemonFiles}/${name}"); + files = + let + confFiles = lib.filesystem.listFilesRecursive "${cobblemonFiles}/config"; + in + builtins.listToAttrs ( + builtins.map (value: { + name = builtins.unsafeDiscardStringContext (lib.strings.removePrefix "${cobblemonFiles}/" value); + inherit value; + }) confFiles + ); + + jvmOpts = lib.concatStringsSep " " [ + "-Xmx8G" + "-Xms8G" + "-XX:+AlwaysPreTouch" + "-XX:+DisableExplicitGC" + "-XX:+ParallelRefProcEnabled" + "-XX:+PerfDisableSharedMem" + "-XX:+UnlockExperimentalVMOptions" + "-XX:+UseG1GC" + "-XX:G1HeapRegionSize=16M" + "-XX:G1HeapWastePercent=5" + "-XX:G1MaxNewSizePercent=50" + "-XX:G1MixedGCCountTarget=4" + "-XX:G1MixedGCLiveThresholdPercent=90" + "-XX:G1NewSizePercent=40" + "-XX:G1RSetUpdatingPauseTimePercent=5" + "-XX:G1ReservePercent=15" + "-XX:InitiatingHeapOccupancyPercent=20" + "-XX:MaxGCPauseMillis=200" + "-XX:MaxTenuringThreshold=1" + "-XX:SurvivorRatio=32" + "-Dusing.aikars.flags=https://mcflags.emc.gs" + "-Daikars.new.flags=true" + "-Djava.net.preferIPv4Stack=true" + "-Djava.net.preferIPv6Addresses=false" + ]; + }; } diff --git a/hosts/tsumugi/gameServers/default.nix b/hosts/tsumugi/gameServers/default.nix index a28722e..6b98c6f 100644 --- a/hosts/tsumugi/gameServers/default.nix +++ b/hosts/tsumugi/gameServers/default.nix @@ -1,26 +1,26 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - imports = [ - inputs.nix-minecraft.nixosModules.minecraft-servers - inputs.steam-servers.nixosModules.default - ./minecraft.nix - ./cobblemon.nix - ./palworld.nix - ]; - nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; + imports = [ + inputs.nix-minecraft.nixosModules.minecraft-servers + inputs.steam-servers.nixosModules.default + ./minecraft.nix + ./cobblemon.nix + ./palworld.nix + ]; + nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; - services.steam-servers.datadir = "/mnt/gameservers/steam"; + services.steam-servers.datadir = "/mnt/gameservers/steam"; - services.minecraft-servers = { - enable = true; - eula = true; - dataDir = "/srv/minecraft"; # /srv/minecraft/paper - runDir = "/run/minecraft"; # tmux -S /run/minecraft/paper.sock attach - }; + services.minecraft-servers = { + enable = true; + eula = true; + dataDir = "/srv/minecraft"; # /srv/minecraft/paper + runDir = "/run/minecraft"; # tmux -S /run/minecraft/paper.sock attach + }; } diff --git a/hosts/tsumugi/gameServers/minecraft.nix b/hosts/tsumugi/gameServers/minecraft.nix index 99edd98..d499a79 100644 --- a/hosts/tsumugi/gameServers/minecraft.nix +++ b/hosts/tsumugi/gameServers/minecraft.nix @@ -1,124 +1,124 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - networking.firewall.allowedTCPPorts = [ - 8100 # bluemap - ]; - services.minecraft-servers.servers.paper = { - enable = true; - openFirewall = true; - autoStart = true; - restart = "always"; - enableReload = false; - serverProperties = { - enable-rcon = false; - enforce-whitelist = true; - white-list = true; - motd = "gameing"; - server-port = 25565; - simulation-distance = 8; - view-distance = 32; - network-compression-threshold = 64; - gamemode = "survival"; - difficulty = "easy"; - }; - #package = pkgs.paperServers.paper-1_21_8; - package = pkgs.paperServers.paper-1_21_8.override { - jre = pkgs.graalvmPackages.graalvm-ce; - }; - symlinks = { - "plugins/bluemap.jar" = pkgs.fetchurl { - url = "https://hangarcdn.papermc.io/plugins/Blue/BlueMap/versions/5.11/PAPER/bluemap-5.11-paper.jar"; - hash = "sha256-PUuWF2UB6KhHt/rOMgmHkOjraaYWgOEoUZfQo9eW1cA="; - }; - "plugins/DamageIndicator.jar" = pkgs.fetchurl { - url = "https://github.com/MagicCheese1/Damage-Indicator/releases/download/v2.2.3/DamageIndicator.jar"; - hash = "sha256-01aeWY1DgbbDE/RHj8DSL/TZcF/MP97FrYY7w4RrTy4="; - }; - "plugins/EssentialsX.jar" = pkgs.fetchurl { - url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsX-2.21.2.jar"; - hash = "sha256-C3WQJvAvPFR8MohvNmbbPB+Uz/c+FBrlZIMT/Q0L38Y="; - }; - "plugins/EssentialsXChat.jar" = pkgs.fetchurl { - url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsXChat-2.21.2.jar"; - hash = "sha256-Htc5MloULVLqyUg+r90yBLUeqnVWIV8D6QY739wACds="; - }; - "plugins/EssentialsXSpawn.jar" = pkgs.fetchurl { - url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsXSpawn-2.21.2.jar"; - hash = "sha256-CnobRGh7bZ2E+vQkNgsuBKKr9FDi2ZmPJ7K6RwZ0a4Y="; - }; - "plugins/FastAsyncWorldEdit.jar" = pkgs.fetchurl { - url = "https://ci.athion.net/job/FastAsyncWorldEdit/1167/artifact/artifacts/FastAsyncWorldEdit-Paper-2.13.2-SNAPSHOT-1167.jar"; - hash = "sha256-Q0Ex3pjIQ+ApVlidUQ4l7TfNMHdD1VFp7JdXjHLjf2M="; - }; - "plugins/LuckPerms.jar" = pkgs.fetchurl { - url = "https://download.luckperms.net/1596/bukkit/loader/LuckPerms-Bukkit-5.5.11.jar"; - hash = "sha256-oBi4uzcDx97rNs69Efeb8WOEtrUFbN9UI3/DzOmiAuI="; - }; - "plugins/multiverse-core.jar" = pkgs.fetchurl { - url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-Core/versions/5.2.1/PAPER/multiverse-core-5.2.1.jar"; - hash = "sha256-KE3e/VRp2KOo1gUiouopMZ06g15umLKpBXoCFdj0v+o="; - }; - "plugins/multiverse-inventories.jar" = pkgs.fetchurl { - url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-Inventories/versions/5.1.2/PAPER/multiverse-inventories-5.1.2.jar"; - hash = "sha256-NxPlOJ4w/s6sSNe5EQWbo8XoG0PAfgQeWdcGZVu+G54="; - }; - "plugins/multiverse-netherportals.jar" = pkgs.fetchurl { - url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-NetherPortals/versions/5.0.3/PAPER/multiverse-netherportals-5.0.3.jar"; - hash = "sha256-H8dCstHnY9LX3tpzTi1s/j9fGS1yy7ePaTuenIQVcNU="; - }; - #"plugins/Slabs.jar" = pkgs.fetchurl { - # url = "https://mediafilez.forgecdn.net/files/2381/666/Slabs-2.2.0.jar"; - # hash = "sha256-95oOuGumIRFcJio+VCXKi1TASVrdEEWf1HYJbVpXkmA="; - #}; - "plugins/TabTPS.jar" = pkgs.fetchurl { - url = "https://hangarcdn.papermc.io/plugins/jmp/TabTPS/versions/1.3.28/PAPER/tabtps-spigot-1.3.28.jar"; - hash = "sha256-qJ0W3LE75i8eO0SoatxGv+YDoN2IldT02uvRS1shG+g="; - }; - "plugins/Vault.jar" = pkgs.fetchurl { - url = "https://github.com/MilkBowl/Vault/releases/download/1.7.3/Vault.jar"; - hash = "sha256-prXtl/Q6XPW7rwCnyM0jxa/JvQA/hJh1r4s25s930B0="; - }; - #"plugins/ViaVersion.jar" = pkgs.fetchurl { - # url = "https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.2.0/PAPER/ViaVersion-5.2.0.jar"; - # hash = "sha256-wM6rCamKhMS0vGdMlgVrZDFzGlLGgu76+s2TVDEnlVs="; - #}; - #"plugins/WorldEditSUI.jar" = pkgs.fetchurl { - # url = "https://github.com/kennytv/WorldEditSUI/releases/download/1.7.4/WorldEditSUI-1.7.4.jar"; - # hash = "sha256-cAbPnllEx14bV8wZ3IjtF/wXmg4oNU/aQkqjKpWqw9g="; - #}; - }; - - jvmOpts = lib.concatStringsSep " " [ - "-Xmx8G" - "-Xms8G" - "-XX:+AlwaysPreTouch" - "-XX:+DisableExplicitGC" - "-XX:+ParallelRefProcEnabled" - "-XX:+PerfDisableSharedMem" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+UseG1GC" - "-XX:G1HeapRegionSize=16M" - "-XX:G1HeapWastePercent=5" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1MixedGCCountTarget=4" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1NewSizePercent=40" - "-XX:G1RSetUpdatingPauseTimePercent=5" - "-XX:G1ReservePercent=15" - "-XX:InitiatingHeapOccupancyPercent=20" - "-XX:MaxGCPauseMillis=200" - "-XX:MaxTenuringThreshold=1" - "-XX:SurvivorRatio=32" - "-Dusing.aikars.flags=https://mcflags.emc.gs" - "-Daikars.new.flags=true" - "-Djava.net.preferIPv4Stack=true" - "-Djava.net.preferIPv6Addresses=false" - ]; + networking.firewall.allowedTCPPorts = [ + 8100 # bluemap + ]; + services.minecraft-servers.servers.paper = { + enable = true; + openFirewall = true; + autoStart = true; + restart = "always"; + enableReload = false; + serverProperties = { + enable-rcon = false; + enforce-whitelist = true; + white-list = true; + motd = "gameing"; + server-port = 25565; + simulation-distance = 8; + view-distance = 32; + network-compression-threshold = 64; + gamemode = "survival"; + difficulty = "easy"; + }; + #package = pkgs.paperServers.paper-1_21_8; + package = pkgs.paperServers.paper-1_21_8.override { + jre = pkgs.graalvmPackages.graalvm-ce; }; + symlinks = { + "plugins/bluemap.jar" = pkgs.fetchurl { + url = "https://hangarcdn.papermc.io/plugins/Blue/BlueMap/versions/5.11/PAPER/bluemap-5.11-paper.jar"; + hash = "sha256-PUuWF2UB6KhHt/rOMgmHkOjraaYWgOEoUZfQo9eW1cA="; + }; + "plugins/DamageIndicator.jar" = pkgs.fetchurl { + url = "https://github.com/MagicCheese1/Damage-Indicator/releases/download/v2.2.3/DamageIndicator.jar"; + hash = "sha256-01aeWY1DgbbDE/RHj8DSL/TZcF/MP97FrYY7w4RrTy4="; + }; + "plugins/EssentialsX.jar" = pkgs.fetchurl { + url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsX-2.21.2.jar"; + hash = "sha256-C3WQJvAvPFR8MohvNmbbPB+Uz/c+FBrlZIMT/Q0L38Y="; + }; + "plugins/EssentialsXChat.jar" = pkgs.fetchurl { + url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsXChat-2.21.2.jar"; + hash = "sha256-Htc5MloULVLqyUg+r90yBLUeqnVWIV8D6QY739wACds="; + }; + "plugins/EssentialsXSpawn.jar" = pkgs.fetchurl { + url = "https://github.com/EssentialsX/Essentials/releases/download/2.21.2/EssentialsXSpawn-2.21.2.jar"; + hash = "sha256-CnobRGh7bZ2E+vQkNgsuBKKr9FDi2ZmPJ7K6RwZ0a4Y="; + }; + "plugins/FastAsyncWorldEdit.jar" = pkgs.fetchurl { + url = "https://ci.athion.net/job/FastAsyncWorldEdit/1167/artifact/artifacts/FastAsyncWorldEdit-Paper-2.13.2-SNAPSHOT-1167.jar"; + hash = "sha256-Q0Ex3pjIQ+ApVlidUQ4l7TfNMHdD1VFp7JdXjHLjf2M="; + }; + "plugins/LuckPerms.jar" = pkgs.fetchurl { + url = "https://download.luckperms.net/1596/bukkit/loader/LuckPerms-Bukkit-5.5.11.jar"; + hash = "sha256-oBi4uzcDx97rNs69Efeb8WOEtrUFbN9UI3/DzOmiAuI="; + }; + "plugins/multiverse-core.jar" = pkgs.fetchurl { + url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-Core/versions/5.2.1/PAPER/multiverse-core-5.2.1.jar"; + hash = "sha256-KE3e/VRp2KOo1gUiouopMZ06g15umLKpBXoCFdj0v+o="; + }; + "plugins/multiverse-inventories.jar" = pkgs.fetchurl { + url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-Inventories/versions/5.1.2/PAPER/multiverse-inventories-5.1.2.jar"; + hash = "sha256-NxPlOJ4w/s6sSNe5EQWbo8XoG0PAfgQeWdcGZVu+G54="; + }; + "plugins/multiverse-netherportals.jar" = pkgs.fetchurl { + url = "https://hangarcdn.papermc.io/plugins/Multiverse/Multiverse-NetherPortals/versions/5.0.3/PAPER/multiverse-netherportals-5.0.3.jar"; + hash = "sha256-H8dCstHnY9LX3tpzTi1s/j9fGS1yy7ePaTuenIQVcNU="; + }; + #"plugins/Slabs.jar" = pkgs.fetchurl { + # url = "https://mediafilez.forgecdn.net/files/2381/666/Slabs-2.2.0.jar"; + # hash = "sha256-95oOuGumIRFcJio+VCXKi1TASVrdEEWf1HYJbVpXkmA="; + #}; + "plugins/TabTPS.jar" = pkgs.fetchurl { + url = "https://hangarcdn.papermc.io/plugins/jmp/TabTPS/versions/1.3.28/PAPER/tabtps-spigot-1.3.28.jar"; + hash = "sha256-qJ0W3LE75i8eO0SoatxGv+YDoN2IldT02uvRS1shG+g="; + }; + "plugins/Vault.jar" = pkgs.fetchurl { + url = "https://github.com/MilkBowl/Vault/releases/download/1.7.3/Vault.jar"; + hash = "sha256-prXtl/Q6XPW7rwCnyM0jxa/JvQA/hJh1r4s25s930B0="; + }; + #"plugins/ViaVersion.jar" = pkgs.fetchurl { + # url = "https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.2.0/PAPER/ViaVersion-5.2.0.jar"; + # hash = "sha256-wM6rCamKhMS0vGdMlgVrZDFzGlLGgu76+s2TVDEnlVs="; + #}; + #"plugins/WorldEditSUI.jar" = pkgs.fetchurl { + # url = "https://github.com/kennytv/WorldEditSUI/releases/download/1.7.4/WorldEditSUI-1.7.4.jar"; + # hash = "sha256-cAbPnllEx14bV8wZ3IjtF/wXmg4oNU/aQkqjKpWqw9g="; + #}; + }; + + jvmOpts = lib.concatStringsSep " " [ + "-Xmx8G" + "-Xms8G" + "-XX:+AlwaysPreTouch" + "-XX:+DisableExplicitGC" + "-XX:+ParallelRefProcEnabled" + "-XX:+PerfDisableSharedMem" + "-XX:+UnlockExperimentalVMOptions" + "-XX:+UseG1GC" + "-XX:G1HeapRegionSize=16M" + "-XX:G1HeapWastePercent=5" + "-XX:G1MaxNewSizePercent=50" + "-XX:G1MixedGCCountTarget=4" + "-XX:G1MixedGCLiveThresholdPercent=90" + "-XX:G1NewSizePercent=40" + "-XX:G1RSetUpdatingPauseTimePercent=5" + "-XX:G1ReservePercent=15" + "-XX:InitiatingHeapOccupancyPercent=20" + "-XX:MaxGCPauseMillis=200" + "-XX:MaxTenuringThreshold=1" + "-XX:SurvivorRatio=32" + "-Dusing.aikars.flags=https://mcflags.emc.gs" + "-Daikars.new.flags=true" + "-Djava.net.preferIPv4Stack=true" + "-Djava.net.preferIPv6Addresses=false" + ]; + }; } diff --git a/hosts/tsumugi/gameServers/palworld.nix b/hosts/tsumugi/gameServers/palworld.nix index e3b55c7..8b66c99 100644 --- a/hosts/tsumugi/gameServers/palworld.nix +++ b/hosts/tsumugi/gameServers/palworld.nix @@ -1,19 +1,19 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - services.steam-servers.palworld = { - palworldServer = { - enable = false; - openFirewall = false; - port = 8211; - worldSettings = { - # see https://palworld.wiki.gg/wiki/PalWorldSettings.ini - }; - }; + services.steam-servers.palworld = { + palworldServer = { + enable = false; + openFirewall = false; + port = 8211; + worldSettings = { + # see https://palworld.wiki.gg/wiki/PalWorldSettings.ini + }; }; + }; } diff --git a/hosts/tsumugi/hardware-configuration.nix b/hosts/tsumugi/hardware-configuration.nix index 770099a..c089f1d 100644 --- a/hosts/tsumugi/hardware-configuration.nix +++ b/hosts/tsumugi/hardware-configuration.nix @@ -2,101 +2,101 @@ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { - config, - lib, - pkgs, - ... + config, + lib, + pkgs, + ... }: { - hardware.enableRedistributableFirmware = true; + hardware.enableRedistributableFirmware = true; - powerManagement = { - enable = true; - powertop.enable = true; - cpuFreqGovernor = "powersave"; - scsiLinkPolicy = "med_power_with_dipm"; - }; + powerManagement = { + enable = true; + powertop.enable = true; + cpuFreqGovernor = "powersave"; + scsiLinkPolicy = "med_power_with_dipm"; + }; - # Bootloader. - boot.loader.systemd-boot = { - enable = true; - configurationLimit = 10; - }; - boot.loader.efi.canTouchEfiVariables = true; + # Bootloader. + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 10; + }; + boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.availableKernelModules = [ - "xhci_pci" - "ahci" - "nvme" - "usbhid" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - systemd.settings.Manager.RuntimeWatchdogSec = "1m"; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/0b6a9c0b-6606-479b-8500-843fb2102c8d"; - fsType = "ext4"; - options = [ - "noatime" - "nodiratime" - "discard" - ]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/3556-44E1"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; - fileSystems."/mnt/cache" = { - device = "/dev/disk/by-uuid/9e921dc4-9e2f-408f-94ed-99747c2bedd0"; - fsType = "ext4"; - options = [ - "noatime" - "nodiratime" - "discard" - ]; - }; + systemd.settings.Manager.RuntimeWatchdogSec = "1m"; - swapDevices = [ - { device = "/dev/disk/by-uuid/290e7047-d429-4196-825d-8fd6cc01d7d5"; } + fileSystems."/" = { + device = "/dev/disk/by-uuid/0b6a9c0b-6606-479b-8500-843fb2102c8d"; + fsType = "ext4"; + options = [ + "noatime" + "nodiratime" + "discard" ]; + }; - # Intel ARC GPU - hardware.graphics.extraPackages = with pkgs; [ - vpl-gpu-rt - intel-media-driver - intel-compute-runtime + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/3556-44E1"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; - environment.systemPackages = with pkgs; [ - intel-gpu-tools + }; + + fileSystems."/mnt/cache" = { + device = "/dev/disk/by-uuid/9e921dc4-9e2f-408f-94ed-99747c2bedd0"; + fsType = "ext4"; + options = [ + "noatime" + "nodiratime" + "discard" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/290e7047-d429-4196-825d-8fd6cc01d7d5"; } + ]; + + # Intel ARC GPU + hardware.graphics.extraPackages = with pkgs; [ + vpl-gpu-rt + intel-media-driver + intel-compute-runtime + ]; + environment.systemPackages = with pkgs; [ + intel-gpu-tools + ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp8s0.useDHCP = lib.mkDefault true; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp8s0.useDHCP = lib.mkDefault true; - nix.settings.system-features = [ "gccarch-skylake" ]; - nixpkgs.hostPlatform = { - #gcc.arch = "skylake"; - #gcc.tune = "skylake"; - system = "x86_64-linux"; - }; + nix.settings.system-features = [ "gccarch-skylake" ]; + nixpkgs.hostPlatform = { + #gcc.arch = "skylake"; + #gcc.tune = "skylake"; + system = "x86_64-linux"; + }; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/tsumugi/iperf.nix b/hosts/tsumugi/iperf.nix index d0c117e..8c0c458 100644 --- a/hosts/tsumugi/iperf.nix +++ b/hosts/tsumugi/iperf.nix @@ -1,13 +1,13 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - services.iperf3 = { - enable = false; - openFirewall = true; # 5201 - }; + services.iperf3 = { + enable = false; + openFirewall = true; # 5201 + }; } diff --git a/hosts/tsumugi/networkMounts.nix b/hosts/tsumugi/networkMounts.nix index 9b34579..413d439 100644 --- a/hosts/tsumugi/networkMounts.nix +++ b/hosts/tsumugi/networkMounts.nix @@ -1,37 +1,37 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - hardMount = true; - mntBenisuzume = name: { - fsType = "nfs"; - device = "10.0.4.3:/var/nfs/shared/${name}"; - options = [ - "nolock" - "hard" - "async" - "fsc" - "noatime" - "nodiratime" - ]; - }; + hardMount = true; + mntBenisuzume = name: { + fsType = "nfs"; + device = "10.0.4.3:/var/nfs/shared/${name}"; + options = [ + "nolock" + "hard" + "async" + "fsc" + "noatime" + "nodiratime" + ]; + }; in { - services.rpcbind.enable = true; - boot.supportedFilesystems = [ "nfs" ]; - environment.systemPackages = [ pkgs.cifs-utils ]; + services.rpcbind.enable = true; + boot.supportedFilesystems = [ "nfs" ]; + environment.systemPackages = [ pkgs.cifs-utils ]; - sops.secrets."benisuzume/cifs" = { }; + sops.secrets."benisuzume/cifs" = { }; - fileSystems."/mnt/media" = mntBenisuzume "media"; - fileSystems."/mnt/gameservers" = mntBenisuzume "gameservers"; + fileSystems."/mnt/media" = mntBenisuzume "media"; + fileSystems."/mnt/gameservers" = mntBenisuzume "gameservers"; - services.cachefilesd = { - enable = true; - cacheDir = "/mnt/cache/fscache"; - }; + services.cachefilesd = { + enable = true; + cacheDir = "/mnt/cache/fscache"; + }; } diff --git a/hosts/tsumugi/openssh.nix b/hosts/tsumugi/openssh.nix index ac5890d..7eb7c91 100644 --- a/hosts/tsumugi/openssh.nix +++ b/hosts/tsumugi/openssh.nix @@ -1,32 +1,34 @@ { - inputs, - config, - pkgs, - lib, - otherHosts, - ... + inputs, + config, + pkgs, + lib, + otherHosts, + ... }: let - forEachOtherHost = f: builtins.map f otherHosts; + forEachOtherHost = f: builtins.map f otherHosts; in { - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - ports = [ 22 ]; - settings = { - PasswordAuthentication = false; - AllowUsers = [ config.sidonia.userName ]; - UseDns = false; - X11Forwarding = false; - PermitRootLogin = "no"; - }; + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + ports = [ 22 ]; + settings = { + PasswordAuthentication = false; + AllowUsers = [ config.sidonia.userName ]; + UseDns = false; + X11Forwarding = false; + PermitRootLogin = "no"; }; + }; - users.users.${config.sidonia.userName}.openssh.authorizedKeys.keys = - (lib.concatLists (forEachOtherHost (remote: with remote.config.sidonia.ssh; lib.optional (pubKey != "") pubKey))) - ++ [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+PU2qFuxv85HjylmQTqmsgR1h9un6bhFeoFlQJ0MgJHNZWPYOavpQqEUQ/SvMH+X7FkiPPyn3u26POhTyUZtgJtVgABi7rs1v1B19ADZ9/9NVW6jNqho7YQpmruNEXqJnIJPMRItq6a6mH9L22X76ti2KjMdh2lluzf9BIBCfiU177VkRx1M4mXdKy2Gd2eLsqoJDnKh/6LqAyO/qzGx6pufAg+id44J9iNrRmJZKm+bZCJUaaRrX5qmNyL/DO7wD+ulFBimt/DEn86R3H1/K04/8ZV4jEmFVKsYh2fGes0ZiHM3oqNCt2okDQpQqqcsZ1bKiA2qSSgCwWJgaIHE9 quinn@QUINN-RYZEN" - ]; + users.users.${config.sidonia.userName}.openssh.authorizedKeys.keys = + (lib.concatLists ( + forEachOtherHost (remote: with remote.config.sidonia.ssh; lib.optional (pubKey != "") pubKey) + )) + ++ [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+PU2qFuxv85HjylmQTqmsgR1h9un6bhFeoFlQJ0MgJHNZWPYOavpQqEUQ/SvMH+X7FkiPPyn3u26POhTyUZtgJtVgABi7rs1v1B19ADZ9/9NVW6jNqho7YQpmruNEXqJnIJPMRItq6a6mH9L22X76ti2KjMdh2lluzf9BIBCfiU177VkRx1M4mXdKy2Gd2eLsqoJDnKh/6LqAyO/qzGx6pufAg+id44J9iNrRmJZKm+bZCJUaaRrX5qmNyL/DO7wD+ulFBimt/DEn86R3H1/K04/8ZV4jEmFVKsYh2fGes0ZiHM3oqNCt2okDQpQqqcsZ1bKiA2qSSgCwWJgaIHE9 quinn@QUINN-RYZEN" + ]; } diff --git a/hosts/tsumugi/reverseProxy.nix b/hosts/tsumugi/reverseProxy.nix index 2553687..3191292 100644 --- a/hosts/tsumugi/reverseProxy.nix +++ b/hosts/tsumugi/reverseProxy.nix @@ -1,38 +1,38 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - sops.secrets."tsumugi/wgpk" = { }; - networking.firewall.allowedUDPPorts = [ 9546 ]; - networking.wg-quick.interfaces.ochiai = { - listenPort = 9546; - address = [ "10.0.0.2/24" ]; - privateKeyFile = config.sops.secrets."tsumugi/wgpk".path; - table = "1234"; - postUp = "ip rule add pref 500 from 10.0.0.2 lookup 1234"; - postDown = "ip rule delete pref 500"; - peers = [ - { - publicKey = "UoMs4Mtp59wHfJwGLygNe01W3vrBXEevEElZ+rs27Xs="; - allowedIPs = [ "0.0.0.0/0" ]; - endpoint = "ochiai.moppu.dev:5964"; - persistentKeepalive = 25; - } - ]; - }; + sops.secrets."tsumugi/wgpk" = { }; + networking.firewall.allowedUDPPorts = [ 9546 ]; + networking.wg-quick.interfaces.ochiai = { + listenPort = 9546; + address = [ "10.0.0.2/24" ]; + privateKeyFile = config.sops.secrets."tsumugi/wgpk".path; + table = "1234"; + postUp = "ip rule add pref 500 from 10.0.0.2 lookup 1234"; + postDown = "ip rule delete pref 500"; + peers = [ + { + publicKey = "UoMs4Mtp59wHfJwGLygNe01W3vrBXEevEElZ+rs27Xs="; + allowedIPs = [ "0.0.0.0/0" ]; + endpoint = "ochiai.moppu.dev:5964"; + persistentKeepalive = 25; + } + ]; + }; - sops.secrets."tsumugi/cloudflare" = { - #owner = "cloudflared"; - }; - services.cloudflared = { - enable = true; - tunnels.tsumugi = { - credentialsFile = config.sops.secrets."tsumugi/cloudflare".path; - default = "http_status:404"; - }; + sops.secrets."tsumugi/cloudflare" = { + #owner = "cloudflared"; + }; + services.cloudflared = { + enable = true; + tunnels.tsumugi = { + credentialsFile = config.sops.secrets."tsumugi/cloudflare".path; + default = "http_status:404"; }; + }; } diff --git a/hosts/tsumugi/transmission.nix b/hosts/tsumugi/transmission.nix index a822ac7..db24aff 100644 --- a/hosts/tsumugi/transmission.nix +++ b/hosts/tsumugi/transmission.nix @@ -1,114 +1,114 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - sops.secrets."tsumugi/transmission" = { - restartUnits = [ "container@transmission.service" ]; - }; - sops.secrets."tsumugi/transmissionwgpk" = { - restartUnits = [ "container@transmission.service" ]; - }; + sops.secrets."tsumugi/transmission" = { + restartUnits = [ "container@transmission.service" ]; + }; + sops.secrets."tsumugi/transmissionwgpk" = { + restartUnits = [ "container@transmission.service" ]; + }; - networking.firewall.allowedTCPPorts = [ 9092 ]; + networking.firewall.allowedTCPPorts = [ 9092 ]; - containers.transmission = - let - realSubnet = "10.0.4.0/24"; - containerSubnet = "192.168.0.0/16"; - hostAddress = "192.168.100.10"; - localAddress = "192.168.100.11"; - hostPort = 9092; - localPort = 9091; - inherit (config.sidonia.lib) configContainerCredential; - in - lib.mkMerge [ + containers.transmission = + let + realSubnet = "10.0.4.0/24"; + containerSubnet = "192.168.0.0/16"; + hostAddress = "192.168.100.10"; + localAddress = "192.168.100.11"; + hostPort = 9092; + localPort = 9091; + inherit (config.sidonia.lib) configContainerCredential; + in + lib.mkMerge [ + { + autoStart = true; + privateNetwork = true; + inherit hostAddress; + inherit localAddress; + forwardPorts = [ + { + containerPort = localPort; + hostPort = hostPort; + protocol = "tcp"; + } + ]; + bindMounts."/mnt/media".isReadOnly = false; + config = { + system = { inherit (config.system) stateVersion; }; + networking = { + firewall.enable = true; + useHostResolvConf = lib.mkForce false; + nameservers = [ "10.0.4.1" ]; + }; + }; + } + (configContainerCredential (cred: { + networking.wg-quick.interfaces.wg0 = { + privateKeyFile = cred; + address = [ "10.2.0.2/32" ]; + dns = [ "10.2.0.1" ]; + postUp = '' + ip route add ${realSubnet} via ${hostAddress} + ip route add ${containerSubnet} via ${hostAddress} + ''; + preDown = '' + ip route delete ${realSubnet} + ip route delete ${containerSubnet} + ''; + peers = [ { - autoStart = true; - privateNetwork = true; - inherit hostAddress; - inherit localAddress; - forwardPorts = [ - { - containerPort = localPort; - hostPort = hostPort; - protocol = "tcp"; - } - ]; - bindMounts."/mnt/media".isReadOnly = false; - config = { - system = { inherit (config.system) stateVersion; }; - networking = { - firewall.enable = true; - useHostResolvConf = lib.mkForce false; - nameservers = [ "10.0.4.1" ]; - }; - }; + publicKey = "YWMbt8hivy0dAHCuK4wFqKFZ54BhlsrLYR07xJzPAQc="; + allowedIPs = [ "0.0.0.0/0" ]; + endpoint = "79.127.145.65:51820"; } - (configContainerCredential (cred: { - networking.wg-quick.interfaces.wg0 = { - privateKeyFile = cred; - address = [ "10.2.0.2/32" ]; - dns = [ "10.2.0.1" ]; - postUp = '' - ip route add ${realSubnet} via ${hostAddress} - ip route add ${containerSubnet} via ${hostAddress} - ''; - preDown = '' - ip route delete ${realSubnet} - ip route delete ${containerSubnet} - ''; - peers = [ - { - publicKey = "YWMbt8hivy0dAHCuK4wFqKFZ54BhlsrLYR07xJzPAQc="; - allowedIPs = [ "0.0.0.0/0" ]; - endpoint = "79.127.145.65:51820"; - } - ]; - }; - }) "wg-quick-wg0" config.sops.secrets."tsumugi/transmissionwgpk".path) - (configContainerCredential (cred: { - systemd.services.transmission = { - serviceConfig = { - # https://github.com/NixOS/nixpkgs/issues/258793 - RootDirectoryStartOnly = lib.mkForce null; - RootDirectory = lib.mkForce null; - }; - }; - services.transmission = { - credentialsFile = cred; - enable = true; - package = inputs.unstable.legacyPackages.x86_64-linux.transmission_4; - openRPCPort = true; - openPeerPorts = true; - settings = - let - speed-limit-enabled = true; # speed limit is in KB/s - mbits = x: ((x * 1000) / 8); - in - { - # https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md - speed-limit-up = mbits 10; - speed-limit-down = mbits 60; - speed-limit-up-enabled = speed-limit-enabled; - speed-limit-down-enabled = speed-limit-enabled; - download-queue-enabled = false; - incomplete-dir-enabled = false; - incomplete-dir = "/mnt/media/data/torrents/.incomplete"; - preallocation = 0; - trash-can-enabled = false; - cache-size-mb = 8192; # avoid accessing the disk too much - rpc-whitelist-enabled = false; - rpc-authentication-required = true; - anti-brute-force-enabled = true; - rpc-bind-address = localAddress; - rpc-port = localPort; - download-dir = "/mnt/media/data/torrents"; - }; - }; - }) "transmission" config.sops.secrets."tsumugi/transmission".path) - ]; + ]; + }; + }) "wg-quick-wg0" config.sops.secrets."tsumugi/transmissionwgpk".path) + (configContainerCredential (cred: { + systemd.services.transmission = { + serviceConfig = { + # https://github.com/NixOS/nixpkgs/issues/258793 + RootDirectoryStartOnly = lib.mkForce null; + RootDirectory = lib.mkForce null; + }; + }; + services.transmission = { + credentialsFile = cred; + enable = true; + package = inputs.unstable.legacyPackages.x86_64-linux.transmission_4; + openRPCPort = true; + openPeerPorts = true; + settings = + let + speed-limit-enabled = true; # speed limit is in KB/s + mbits = x: ((x * 1000) / 8); + in + { + # https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md + speed-limit-up = mbits 10; + speed-limit-down = mbits 60; + speed-limit-up-enabled = speed-limit-enabled; + speed-limit-down-enabled = speed-limit-enabled; + download-queue-enabled = false; + incomplete-dir-enabled = false; + incomplete-dir = "/mnt/media/data/torrents/.incomplete"; + preallocation = 0; + trash-can-enabled = false; + cache-size-mb = 8192; # avoid accessing the disk too much + rpc-whitelist-enabled = false; + rpc-authentication-required = true; + anti-brute-force-enabled = true; + rpc-bind-address = localAddress; + rpc-port = localPort; + download-dir = "/mnt/media/data/torrents"; + }; + }; + }) "transmission" config.sops.secrets."tsumugi/transmission".path) + ]; } diff --git a/hosts/tsumugi/ups.nix b/hosts/tsumugi/ups.nix index 7ea9117..441882d 100644 --- a/hosts/tsumugi/ups.nix +++ b/hosts/tsumugi/ups.nix @@ -1,62 +1,62 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: { - sops.secrets."tsumugi/nutPass" = { }; - power.ups = { - enable = false; - mode = "netserver"; - openFirewall = true; - users.powercoolmon = { - passwordFile = config.sops.secrets."tsumugi/nutPass".path; - upsmon = "primary"; - }; - upsd.listen = [ - { - address = "10.0.4.2"; - port = 3493; - } - ]; - upsmon = { - settings.NOTIFYFLAG = [ - [ - "COMMOK" - "SYSLOG" - ] - [ - "COMMBAD" - "SYSLOG" - ] - [ - "NOCOMM" - "SYSLOG" - ] - ]; - monitor.powercool = { - user = "powercoolmon"; - type = "primary"; - system = "powercool@localhost:3493"; - powerValue = 1; - passwordFile = config.sops.secrets."tsumugi/nutPass".path; - }; - }; - ups.powercool = { - description = "Powercool UPS 1500VA"; - driver = "nutdrv_qx"; - port = "auto"; - directives = [ - "vendorid = 0001" - "productid = 0000" - "product = \"MEC0003\"" - "protocol = hunnox" - "langid_fix = 0x409" - "novendor" - "noscanlangid" - ]; - }; + sops.secrets."tsumugi/nutPass" = { }; + power.ups = { + enable = false; + mode = "netserver"; + openFirewall = true; + users.powercoolmon = { + passwordFile = config.sops.secrets."tsumugi/nutPass".path; + upsmon = "primary"; }; + upsd.listen = [ + { + address = "10.0.4.2"; + port = 3493; + } + ]; + upsmon = { + settings.NOTIFYFLAG = [ + [ + "COMMOK" + "SYSLOG" + ] + [ + "COMMBAD" + "SYSLOG" + ] + [ + "NOCOMM" + "SYSLOG" + ] + ]; + monitor.powercool = { + user = "powercoolmon"; + type = "primary"; + system = "powercool@localhost:3493"; + powerValue = 1; + passwordFile = config.sops.secrets."tsumugi/nutPass".path; + }; + }; + ups.powercool = { + description = "Powercool UPS 1500VA"; + driver = "nutdrv_qx"; + port = "auto"; + directives = [ + "vendorid = 0001" + "productid = 0000" + "product = \"MEC0003\"" + "protocol = hunnox" + "langid_fix = 0x409" + "novendor" + "noscanlangid" + ]; + }; + }; } diff --git a/hosts/yuhata/default.nix b/hosts/yuhata/default.nix index 5cb797e..42b212a 100644 --- a/hosts/yuhata/default.nix +++ b/hosts/yuhata/default.nix @@ -1,16 +1,16 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ ./os ]; - home-manager.users.${config.sidonia.userName}.imports = [ ./home ]; - sops = { - defaultSopsFile = ../../secrets/secrets.yaml; - defaultSopsFormat = "yaml"; - age.keyFile = "/home/midorikawa/.config/sops/age/keys.txt"; - }; + imports = [ ./os ]; + home-manager.users.${config.sidonia.userName}.imports = [ ./home ]; + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/midorikawa/.config/sops/age/keys.txt"; + }; } diff --git a/hosts/yuhata/home/default.nix b/hosts/yuhata/home/default.nix index b1027dc..1654abc 100644 --- a/hosts/yuhata/home/default.nix +++ b/hosts/yuhata/home/default.nix @@ -1,15 +1,15 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./home.nix - ./monitors.nix - #./wayvr.nix - ]; + imports = [ + ./home.nix + ./monitors.nix + #./wayvr.nix + ]; } diff --git a/hosts/yuhata/home/home.nix b/hosts/yuhata/home/home.nix index 677de43..d44240a 100644 --- a/hosts/yuhata/home/home.nix +++ b/hosts/yuhata/home/home.nix @@ -1,23 +1,23 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: { - home.packages = with pkgs; [ - nix-index - bs-manager - via - qmk - (limo.override { withUnrar = true; }) - veadotube - # (pkgs.callPackage ../packages/brow6el.nix { }) - wl-clipboard - ]; - programs = { - mangohud.enable = true; - }; + home.packages = with pkgs; [ + nix-index + bs-manager + via + qmk + (limo.override { withUnrar = true; }) + veadotube + # (pkgs.callPackage ../packages/brow6el.nix { }) + wl-clipboard + ]; + programs = { + mangohud.enable = true; + }; } diff --git a/hosts/yuhata/home/monitors.nix b/hosts/yuhata/home/monitors.nix index 1e82e69..a4a510c 100644 --- a/hosts/yuhata/home/monitors.nix +++ b/hosts/yuhata/home/monitors.nix @@ -1,61 +1,61 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: let - tv = "d%Q90A"; - zowie = "d%ZOWIE"; - ultrawide = "d%P40w-20"; - replaceSeps = - from: to: str: - lib.concatStringsSep to (lib.splitString from str); + tv = "d%Q90A"; + zowie = "d%ZOWIE"; + ultrawide = "d%P40w-20"; + replaceSeps = + from: to: str: + lib.concatStringsSep to (lib.splitString from str); in { - wayland.windowManager.niri.settings.output = [ - { - _args = [ "Lenovo Group Limited P40w-20 V9095052" ]; - layout.default-column-width.proportion = 1.0 / 3.0; - } - ]; - services.shikane = { - enable = true; - settings.profile = [ - { - name = "Workstation Monitors"; - output = [ - { - search = zowie; - enable = true; - scale = 1.0; - mode = "1920x1080@60"; - position = "4800,400"; - } - { - search = ultrawide; - enable = true; - scale = 1.07; - mode = "5120x2160@74.98"; - position = "0,0"; - } - ]; - } - { - name = "Living Room TV"; - output = [ - { - search = tv; - enable = true; - scale = 1.5; - adaptive_sync = true; - mode = "3840x2160@120"; - position = "0,0"; - } - ]; - } + wayland.windowManager.niri.settings.output = [ + { + _args = [ "Lenovo Group Limited P40w-20 V9095052" ]; + layout.default-column-width.proportion = 1.0 / 3.0; + } + ]; + services.shikane = { + enable = true; + settings.profile = [ + { + name = "Workstation Monitors"; + output = [ + { + search = zowie; + enable = true; + scale = 1.0; + mode = "1920x1080@60"; + position = "4800,400"; + } + { + search = ultrawide; + enable = true; + scale = 1.07; + mode = "5120x2160@74.98"; + position = "0,0"; + } + ]; + } + { + name = "Living Room TV"; + output = [ + { + search = tv; + enable = true; + scale = 1.5; + adaptive_sync = true; + mode = "3840x2160@120"; + position = "0,0"; + } ]; - }; + } + ]; + }; } diff --git a/hosts/yuhata/home/wayvr.nix b/hosts/yuhata/home/wayvr.nix index 5f2e09f..736f63d 100644 --- a/hosts/yuhata/home/wayvr.nix +++ b/hosts/yuhata/home/wayvr.nix @@ -1,97 +1,97 @@ { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: let - # See: https://github.com/wlx-team/wayvr/wiki - wayvrConfig = - with (builtins.mapAttrs (n: v: "#${v}") config.catppuccin.lib.color); - (pkgs.formats.yaml { }).generate "config.yaml" { - # This is the main config for WayVR - # Place this file in ~/.config/wayvr/conf.d and tweak the values. - # Default values are shown unless noted otherwise. + # See: https://github.com/wlx-team/wayvr/wiki + wayvrConfig = + with (builtins.mapAttrs (n: v: "#${v}") config.catppuccin.lib.color); + (pkgs.formats.yaml { }).generate "config.yaml" { + # This is the main config for WayVR + # Place this file in ~/.config/wayvr/conf.d and tweak the values. + # Default values are shown unless noted otherwise. - # In case you're not getting the expected result, - # check the logs at /tmp/wlx.log for parsing errors. + # In case you're not getting the expected result, + # check the logs at /tmp/wlx.log for parsing errors. - ## Only if built with `osc` feature. What port to send OSC messages to. - #osc_out_port: 9000 + ## Only if built with `osc` feature. What port to send OSC messages to. + #osc_out_port: 9000 - ## Set your preferred watch timezones here. - timezones = [ "Europe/Dublin" ]; + ## Set your preferred watch timezones here. + timezones = [ "Europe/Dublin" ]; - ## On most desktops, WayVR is able to pick up your keymap via wayland. (Especially when using Fcitx5!) - ## However, if this does not happen, you might want to set your keymap by hand. - ## When using a simple layout: - #default_keymap: us - # - ## When defining a layout-variant pair, separate using a dash: - #default_keymap: us-colemak_dh + ## On most desktops, WayVR is able to pick up your keymap via wayland. (Especially when using Fcitx5!) + ## However, if this does not happen, you might want to set your keymap by hand. + ## When using a simple layout: + #default_keymap: us + # + ## When defining a layout-variant pair, separate using a dash: + #default_keymap: us-colemak_dh - ## Path to read the custom theme from, relative to `~/.config/wayvr` - #theme_path: "theme" + ## Path to read the custom theme from, relative to `~/.config/wayvr` + #theme_path: "theme" - ## These can be used to control the color theme of WayVR. - color_text = text; - color_accent = accent; - color_danger = flamingo; - color_faded = overlay0; - color_background = base; + ## These can be used to control the color theme of WayVR. + color_text = text; + color_accent = accent; + color_danger = flamingo; + color_faded = overlay0; + color_background = base; - ## Path to custom skybox texture, relative to `~/.config/wayvr` - #skybox_texture: "" + ## Path to custom skybox texture, relative to `~/.config/wayvr` + #skybox_texture: "" - ## User-defined list of custom overlays that should be created. - ## Each entry must correspond to an XML file at: {theme_path}/gui/{entry}.xml - #custom_panels: - # - "test" + ## User-defined list of custom overlays that should be created. + ## Each entry must correspond to an XML file at: {theme_path}/gui/{entry}.xml + #custom_panels: + # - "test" - ## The alt_click binding can be used to execute a program of choice - ## These are not default, but example values. - #alt_click_down: ["bash", "-c", "echo x"] - #alt_click_up: ["bash", "-c", "echo y"] + ## The alt_click binding can be used to execute a program of choice + ## These are not default, but example values. + #alt_click_down: ["bash", "-c", "echo x"] + #alt_click_up: ["bash", "-c", "echo y"] - ## Example for quick-calibration with `motoc`: - #alt_click_down: - # [ - # "motoc", - # "calibrate", - # "--src", - # "WiVRn HMD", - # "--dst", - # "LHR-AABBCCDD", - # "--samples", - # "200", - # ] + ## Example for quick-calibration with `motoc`: + #alt_click_down: + # [ + # "motoc", + # "calibrate", + # "--src", + # "WiVRn HMD", + # "--dst", + # "LHR-AABBCCDD", + # "--samples", + # "200", + # ] - ## Set what kind of notifications to show and what to hide - #notification_topics: - # System: Center - # DesktopNotification: Center - # XSNotification: Center - # IpdChange: Hide + ## Set what kind of notifications to show and what to hide + #notification_topics: + # System: Center + # DesktopNotification: Center + # XSNotification: Center + # IpdChange: Hide - ## Path to a custom notification sound, relative to `~/.config/wayvr` - #notification_sound: "" + ## Path to a custom notification sound, relative to `~/.config/wayvr` + #notification_sound: "" - ## If `screen_render_down` is enabled, - ## controls the maximum height of the screen - #screen_max_height: 1440 + ## If `screen_render_down` is enabled, + ## controls the maximum height of the screen + #screen_max_height: 1440 - ## Don't move the mouse more often than this value - ## helps to avoid unnecessary load when pairing - ## a high-refresh screen with a lower-refresh hmd - #mouse_move_interval_ms: 10 - }; + ## Don't move the mouse more often than this value + ## helps to avoid unnecessary load when pairing + ## a high-refresh screen with a lower-refresh hmd + #mouse_move_interval_ms: 10 + }; in { - # https://github.com/NixOS/nixpkgs/pull/479448 - home.packages = [ - pkgs.wayvr - ]; - xdg.configFile."wayvr/conf.d/config.yaml".source = wayvrConfig; + # https://github.com/NixOS/nixpkgs/pull/479448 + home.packages = [ + pkgs.wayvr + ]; + xdg.configFile."wayvr/conf.d/config.yaml".source = wayvrConfig; } diff --git a/hosts/yuhata/os/configuration.nix b/hosts/yuhata/os/configuration.nix index d1f2fc3..703d36b 100644 --- a/hosts/yuhata/os/configuration.nix +++ b/hosts/yuhata/os/configuration.nix @@ -1,67 +1,67 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - hardware.bluetooth = { - powerOnBoot = true; - settings = { - General = { - Experimental = true; - FastConnectable = true; - }; - }; + hardware.bluetooth = { + powerOnBoot = true; + settings = { + General = { + Experimental = true; + FastConnectable = true; + }; }; - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "lavender"; + }; + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "lavender"; + }; + networking.hostName = "yuhata"; + system.stateVersion = "25.05"; + sidonia = { + userName = "midorikawa"; + ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJDCi7RR4mckEAgC7mVNFHNvzTg3JwvcKYrYKXqf1Hew midorikawa@yuhata"; + services = { + distributedBuilds.client.enable = false; + vr.enable = false; }; - networking.hostName = "yuhata"; - system.stateVersion = "25.05"; - sidonia = { - userName = "midorikawa"; - ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJDCi7RR4mckEAgC7mVNFHNvzTg3JwvcKYrYKXqf1Hew midorikawa@yuhata"; - services = { - distributedBuilds.client.enable = false; - vr.enable = false; - }; - geolocation.enable = true; - desktop.enable = true; - text.comicCode.enable = true; - tweaks = { - audio = { - behringerFix.enable = true; - lowLatency = { - enable = true; - quantum = 128; - rate = 48000; - }; - }; + geolocation.enable = true; + desktop.enable = true; + text.comicCode.enable = true; + tweaks = { + audio = { + behringerFix.enable = true; + lowLatency = { + enable = true; + quantum = 128; + rate = 48000; }; + }; }; + }; - services.hardware.openrgb.enable = true; - nixpkgs.config.permittedInsecurePackages = [ - pkgs.mbedtls_2.name # for openrgb service - pkgs.openssl_1_1.name # for openrgb service - ]; + services.hardware.openrgb.enable = true; + nixpkgs.config.permittedInsecurePackages = [ + pkgs.mbedtls_2.name # for openrgb service + pkgs.openssl_1_1.name # for openrgb service + ]; - programs = { - sleepy-launcher.enable = true; - coolercontrol.enable = true; - steam.remotePlay.openFirewall = true; - gamescope.enable = true; - kdeconnect.enable = true; - }; - hardware.keyboard.qmk.enable = true; - services.udev.packages = [ - pkgs.via - pkgs.huion-switcher - ]; - boot.kernelModules = [ "digimend" ]; # for huion 540 tablet + programs = { + sleepy-launcher.enable = true; + coolercontrol.enable = true; + steam.remotePlay.openFirewall = true; + gamescope.enable = true; + kdeconnect.enable = true; + }; + hardware.keyboard.qmk.enable = true; + services.udev.packages = [ + pkgs.via + pkgs.huion-switcher + ]; + boot.kernelModules = [ "digimend" ]; # for huion 540 tablet } diff --git a/hosts/yuhata/os/default.nix b/hosts/yuhata/os/default.nix index 4366f76..0260230 100644 --- a/hosts/yuhata/os/default.nix +++ b/hosts/yuhata/os/default.nix @@ -1,17 +1,17 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./configuration.nix - ./gamemode.nix - ./hardware-configuration.nix - ./lix.nix - ./networkMounts.nix - ./steam.nix - ]; + imports = [ + ./configuration.nix + ./gamemode.nix + ./hardware-configuration.nix + ./lix.nix + ./networkMounts.nix + ./steam.nix + ]; } diff --git a/hosts/yuhata/os/gamemode.nix b/hosts/yuhata/os/gamemode.nix index 4faea36..2a9d5ae 100644 --- a/hosts/yuhata/os/gamemode.nix +++ b/hosts/yuhata/os/gamemode.nix @@ -1,42 +1,42 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - users.users.midorikawa.extraGroups = [ "gamemode" ]; - nixpkgs.overlays = [ - (final: prev: { - gamemode = prev.gamemode.overrideAttrs ( - finalAttrs: prevAttrs: { - src = final.fetchFromGitHub { - owner = "FeralInteractive"; - repo = "gamemode"; - rev = "f0a569a5199974751a4a75ebdc41c8f0b8e4c909"; - hash = "sha256-9DB8iWiyrM4EJ94ERC5SE9acrhqeI00BF1wU0umeNFg="; - }; - } - ); - }) - ]; - programs.gamemode = { - enable = true; - enableRenice = true; - settings = { - # man gamemoded(8) - general = { - renice = 10; - }; - gpu = { - apply_gpu_optimisations = "accept-responsibility"; - gpu_device = 1; - nv_per_profile_editable = 0; # https://github.com/FeralInteractive/gamemode/pull/547 - #nv_powermizer_mode = 1; - #nv_core_clock_mhz_offset = 0; - #nv_mem_clock_mhz_offset = 0; - }; - }; + users.users.midorikawa.extraGroups = [ "gamemode" ]; + nixpkgs.overlays = [ + (final: prev: { + gamemode = prev.gamemode.overrideAttrs ( + finalAttrs: prevAttrs: { + src = final.fetchFromGitHub { + owner = "FeralInteractive"; + repo = "gamemode"; + rev = "f0a569a5199974751a4a75ebdc41c8f0b8e4c909"; + hash = "sha256-9DB8iWiyrM4EJ94ERC5SE9acrhqeI00BF1wU0umeNFg="; + }; + } + ); + }) + ]; + programs.gamemode = { + enable = true; + enableRenice = true; + settings = { + # man gamemoded(8) + general = { + renice = 10; + }; + gpu = { + apply_gpu_optimisations = "accept-responsibility"; + gpu_device = 1; + nv_per_profile_editable = 0; # https://github.com/FeralInteractive/gamemode/pull/547 + #nv_powermizer_mode = 1; + #nv_core_clock_mhz_offset = 0; + #nv_mem_clock_mhz_offset = 0; + }; }; + }; } diff --git a/hosts/yuhata/os/hardware-configuration.nix b/hosts/yuhata/os/hardware-configuration.nix index 9e875ae..c0fa505 100644 --- a/hosts/yuhata/os/hardware-configuration.nix +++ b/hosts/yuhata/os/hardware-configuration.nix @@ -1,92 +1,92 @@ { - config, - lib, - pkgs, - inputs, - ... + config, + lib, + pkgs, + inputs, + ... }: { - hardware.enableRedistributableFirmware = true; - boot.loader = { - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - windows."11".efiDeviceHandle = "HD0b"; - edk2-uefi-shell.enable = true; - memtest86.enable = true; - configurationLimit = 20; - }; - grub = { - enable = false; - devices = [ "nodev" ]; - efiSupport = true; - useOSProber = true; - configurationLimit = 20; - }; + hardware.enableRedistributableFirmware = true; + boot.loader = { + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + windows."11".efiDeviceHandle = "HD0b"; + edk2-uefi-shell.enable = true; + memtest86.enable = true; + configurationLimit = 20; }; + grub = { + enable = false; + devices = [ "nodev" ]; + efiSupport = true; + useOSProber = true; + configurationLimit = 20; + }; + }; - boot.initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ - "kvm-amd" - "ntsync" - "nvidia" - "nvidia_modeset" - "nvidia_uvm" - "nvidia_drm" - ]; - boot.extraModulePackages = [ ]; + boot.kernelModules = [ + "kvm-amd" + "ntsync" + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/26c580c5-ca8b-4df5-a631-54fb68cd61f4"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/26c580c5-ca8b-4df5-a631-54fb68cd61f4"; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/EBE7-D290"; - fsType = "vfat"; - options = [ - "fmask=0077" - "dmask=0077" - ]; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/4ccd9516-6157-4bcc-a49f-6298e6ec70d4"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/EBE7-D290"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; - open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.latest; # latest/beta/production/stable - }; + swapDevices = [ + { device = "/dev/disk/by-uuid/4ccd9516-6157-4bcc-a49f-6298e6ec70d4"; } + ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.latest; # latest/beta/production/stable + }; - nix.settings.system-features = [ "gccarch-znver3" ]; - nixpkgs.hostPlatform = { - #gcc.arch = "znver3"; - #gcc.tune = "znver3"; - system = "x86_64-linux"; - }; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + + nix.settings.system-features = [ "gccarch-znver3" ]; + nixpkgs.hostPlatform = { + #gcc.arch = "znver3"; + #gcc.tune = "znver3"; + system = "x86_64-linux"; + }; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/hosts/yuhata/os/lix.nix b/hosts/yuhata/os/lix.nix index 8ac561d..e70169f 100644 --- a/hosts/yuhata/os/lix.nix +++ b/hosts/yuhata/os/lix.nix @@ -1,20 +1,20 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - nixpkgs.overlays = [ - (final: prev: { - inherit (prev.lixPackageSets.stable) - nixpkgs-review - nix-eval-jobs - nix-fast-build - colmena - ; - }) - ]; - nix.package = pkgs.lixPackageSets.stable.lix; + nixpkgs.overlays = [ + (final: prev: { + inherit (prev.lixPackageSets.stable) + nixpkgs-review + nix-eval-jobs + nix-fast-build + colmena + ; + }) + ]; + nix.package = pkgs.lixPackageSets.stable.lix; } diff --git a/hosts/yuhata/os/networkMounts.nix b/hosts/yuhata/os/networkMounts.nix index 36ea5e9..44d8d8d 100644 --- a/hosts/yuhata/os/networkMounts.nix +++ b/hosts/yuhata/os/networkMounts.nix @@ -1,68 +1,68 @@ { - inputs, - config, - pkgs, - lib, - ... + inputs, + config, + pkgs, + lib, + ... }: let - benisuzumeIP = "10.0.4.3"; - unasCIFS = addr: name: "//${addr}/${name}"; - unasNFS = addr: name: "${addr}:/var/nfs/shared/${name}"; + benisuzumeIP = "10.0.4.3"; + unasCIFS = addr: name: "//${addr}/${name}"; + unasNFS = addr: name: "${addr}:/var/nfs/shared/${name}"; - mntUnasCIFS = addr: name: { - fsType = "cifs"; - device = unasCIFS addr name; - options = [ - "credentials=${config.sops.secrets."benisuzume/cifs".path}" - "uid=${config.sidonia.userName}" - "gid=users" - "rw" - "exec" - "nofail" - "x-systemd.automount" - "x-systemd.device-timeout=60s" - "fsc" - ]; - }; + mntUnasCIFS = addr: name: { + fsType = "cifs"; + device = unasCIFS addr name; + options = [ + "credentials=${config.sops.secrets."benisuzume/cifs".path}" + "uid=${config.sidonia.userName}" + "gid=users" + "rw" + "exec" + "nofail" + "x-systemd.automount" + "x-systemd.device-timeout=60s" + "fsc" + ]; + }; - mntUnasNFS = addr: name: { - fsType = "nfs"; - device = unasNFS addr name; - options = [ - "hard" - "noacl" - "noatime" - "nodiratime" - "x-systemd.automount" - "x-systemd.device-timeout=60s" - "nofail" - "fsc" - ]; - }; + mntUnasNFS = addr: name: { + fsType = "nfs"; + device = unasNFS addr name; + options = [ + "hard" + "noacl" + "noatime" + "nodiratime" + "x-systemd.automount" + "x-systemd.device-timeout=60s" + "nofail" + "fsc" + ]; + }; - mntBenisuzumeCIFS = name: mntUnasCIFS benisuzumeIP name; - mntBenisuzumeNFS = name: mntUnasNFS benisuzumeIP name; + mntBenisuzumeCIFS = name: mntUnasCIFS benisuzumeIP name; + mntBenisuzumeNFS = name: mntUnasNFS benisuzumeIP name; in { - services.rpcbind.enable = true; - boot.supportedFilesystems = [ "nfs" ]; - environment.systemPackages = [ - pkgs.nfs-utils - pkgs.cifs-utils - ]; + services.rpcbind.enable = true; + boot.supportedFilesystems = [ "nfs" ]; + environment.systemPackages = [ + pkgs.nfs-utils + pkgs.cifs-utils + ]; - sops.secrets."benisuzume/cifs" = { }; + sops.secrets."benisuzume/cifs" = { }; - fileSystems."/mnt/benisuzume" = mntBenisuzumeCIFS "personal-drive"; - fileSystems."/mnt/steam" = mntBenisuzumeNFS "steam"; + fileSystems."/mnt/benisuzume" = mntBenisuzumeCIFS "personal-drive"; + fileSystems."/mnt/steam" = mntBenisuzumeNFS "steam"; - services.cachefilesd = { - enable = true; - extraConfig = '' - brun 30% - bcull 20% - bstop 10% - ''; - }; + services.cachefilesd = { + enable = true; + extraConfig = '' + brun 30% + bcull 20% + bstop 10% + ''; + }; } diff --git a/hosts/yuhata/os/steam.nix b/hosts/yuhata/os/steam.nix index 3a0ac53..7d471ff 100644 --- a/hosts/yuhata/os/steam.nix +++ b/hosts/yuhata/os/steam.nix @@ -1,31 +1,31 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - programs.steam = { - extraEnv = { - PROTON_ENABLE_NVAPI = 1; - PROTON_ENABLE_WAYLAND = null; - PROTON_ENABLE_HDR = null; - PROTON_FSR4_UPGRADE = null; - PROTON_DLSS_UPGRADE = null; - #PROTON_DXVK_GPLASYNC = 1; - PROTON_DXVK_LLASYNC = 1; # enables dxvk lowlatency and gplasync - #WINE_USE_TAKE_FOCUS = 1; - WINE_CPU_TOPOLOGY = "16:0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23"; # use one CCD - # https://github.com/NixOS/nixpkgs/issues/162562#issuecomment-1523177264 - SDL_VIDEODRIVER = null; - SCB_GAMESCOPE_ARGS = "-f -w 5120 -h 2160 -W 5120 -H 2160 -r 150 --force-grab-cursor"; - }; - extraPackages = with pkgs; [ - gamescope - scopebuddy - wlr-randr - jq - ]; + programs.steam = { + extraEnv = { + PROTON_ENABLE_NVAPI = 1; + PROTON_ENABLE_WAYLAND = null; + PROTON_ENABLE_HDR = null; + PROTON_FSR4_UPGRADE = null; + PROTON_DLSS_UPGRADE = null; + #PROTON_DXVK_GPLASYNC = 1; + PROTON_DXVK_LLASYNC = 1; # enables dxvk lowlatency and gplasync + #WINE_USE_TAKE_FOCUS = 1; + WINE_CPU_TOPOLOGY = "16:0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23"; # use one CCD + # https://github.com/NixOS/nixpkgs/issues/162562#issuecomment-1523177264 + SDL_VIDEODRIVER = null; + SCB_GAMESCOPE_ARGS = "-f -w 5120 -h 2160 -W 5120 -H 2160 -r 150 --force-grab-cursor"; }; + extraPackages = with pkgs; [ + gamescope + scopebuddy + wlr-randr + jq + ]; + }; } diff --git a/hosts/yuhata/packages/rootapp.nix b/hosts/yuhata/packages/rootapp.nix index 7ede78c..5472a6e 100644 --- a/hosts/yuhata/packages/rootapp.nix +++ b/hosts/yuhata/packages/rootapp.nix @@ -1,27 +1,27 @@ { - lib, - appimageTools, - fetchurl, + lib, + appimageTools, + fetchurl, }: let - pname = "rootapp"; - version = "0.9.109"; - src = fetchurl { - url = "https://installer.rootapp.com/installer/Linux/X64/Root.AppImage"; - hash = "sha256-7SzdSX8yti45gQ/JKtqazYwUcfbSk1zMiHdKdY/UVRk="; - }; + pname = "rootapp"; + version = "0.9.109"; + src = fetchurl { + url = "https://installer.rootapp.com/installer/Linux/X64/Root.AppImage"; + hash = "sha256-7SzdSX8yti45gQ/JKtqazYwUcfbSk1zMiHdKdY/UVRk="; + }; - appimageContents = appimageTools.extract { - inherit pname version src; - postExtract = '' - substituteInPlace $out/Root.desktop --replace-fail 'Exec=Root' 'Exec=rootapp' - ''; - }; -in -appimageTools.wrapType2 { + appimageContents = appimageTools.extract { inherit pname version src; - extraInstallCommands = '' - install -m 444 -D ${appimageContents}/Root.desktop $out/share/applications/Root.desktop - install -m 444 -D ${appimageContents}/Root.png $out/share/icons/hicolor/512x512/apps/Root.png + postExtract = '' + substituteInPlace $out/Root.desktop --replace-fail 'Exec=Root' 'Exec=rootapp' ''; + }; +in +appimageTools.wrapType2 { + inherit pname version src; + extraInstallCommands = '' + install -m 444 -D ${appimageContents}/Root.desktop $out/share/applications/Root.desktop + install -m 444 -D ${appimageContents}/Root.png $out/share/icons/hicolor/512x512/apps/Root.png + ''; } diff --git a/hosts/yure/default.nix b/hosts/yure/default.nix index 01449b9..567d198 100644 --- a/hosts/yure/default.nix +++ b/hosts/yure/default.nix @@ -1,35 +1,35 @@ { - config, - pkgs, - inputs, - lib, - ... + config, + pkgs, + inputs, + lib, + ... }: { - imports = [ - ./hardware-configuration.nix - ]; - networking.hostName = "yure"; - nix.settings.max-jobs = 1; # set to 0 to use remote builder only - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "green"; - }; - system.stateVersion = "24.05"; - sidonia = { - userName = "shinatose"; - ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICw5RRyu1jEMpS5ekIfbdaHtWU/IyZ62LhfqK8xUIjGY shinatose@yure"; - services.distributedBuilds.client.enable = false; - graphics.legacyGpu = true; - desktop.enable = true; - geolocation.enable = true; - text.comicCode.enable = true; - isLaptop = true; - }; - services.xserver.xkb = { - layout = "gb,us"; - model = "thinkpad60"; - }; - home-manager.users.${config.sidonia.userName}.imports = [ ./home.nix ]; + imports = [ + ./hardware-configuration.nix + ]; + networking.hostName = "yure"; + nix.settings.max-jobs = 1; # set to 0 to use remote builder only + catppuccin = { + enable = true; + flavor = "mocha"; + accent = "green"; + }; + system.stateVersion = "24.05"; + sidonia = { + userName = "shinatose"; + ssh.pubKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICw5RRyu1jEMpS5ekIfbdaHtWU/IyZ62LhfqK8xUIjGY shinatose@yure"; + services.distributedBuilds.client.enable = false; + graphics.legacyGpu = true; + desktop.enable = true; + geolocation.enable = true; + text.comicCode.enable = true; + isLaptop = true; + }; + services.xserver.xkb = { + layout = "gb,us"; + model = "thinkpad60"; + }; + home-manager.users.${config.sidonia.userName}.imports = [ ./home.nix ]; } diff --git a/hosts/yure/hardware-configuration.nix b/hosts/yure/hardware-configuration.nix index 8b20842..7b470e4 100644 --- a/hosts/yure/hardware-configuration.nix +++ b/hosts/yure/hardware-configuration.nix @@ -1,129 +1,129 @@ { - inputs, - config, - lib, - pkgs, - ... + inputs, + config, + lib, + pkgs, + ... }: { - hardware.enableRedistributableFirmware = true; + hardware.enableRedistributableFirmware = true; - # This is a dual core system :) - nix.settings.cores = 1; + # This is a dual core system :) + nix.settings.cores = 1; - boot.loader.grub = { - enable = true; - device = "/dev/sda"; - useOSProber = true; - gfxmodeBios = "1280x1024,auto"; - gfxpayloadBios = "keep"; - configurationLimit = 20; - }; + boot.loader.grub = { + enable = true; + device = "/dev/sda"; + useOSProber = true; + gfxmodeBios = "1280x1024,auto"; + gfxpayloadBios = "keep"; + configurationLimit = 20; + }; - boot.initrd.availableKernelModules = [ - "uhci_hcd" - "ehci_pci" - "ata_piix" - "ahci" - "firewire_ohci" - "usb_storage" - "sd_mod" - "sdhci_pci" - ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ata_piix" + "ahci" + "firewire_ohci" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; - boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ - "kvm-intel" - "tp_smapi" - "ntsync" - ]; - boot.extraModulePackages = [ ]; + boot.kernelModules = [ + "kvm-intel" + "tp_smapi" + "ntsync" + ]; + boot.extraModulePackages = [ ]; - fileSystems."/" = { - device = "/dev/disk/by-uuid/6be0b367-cd67-468c-8792-4e53dc357244"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/6be0b367-cd67-468c-8792-4e53dc357244"; + fsType = "ext4"; + }; - # https://aur.archlinux.org/packages/libcrystalhd + # https://aur.archlinux.org/packages/libcrystalhd - swapDevices = [ { device = "/dev/disk/by-uuid/a55aed88-5155-4c6a-8508-34360cd1212a"; } ]; - boot.resumeDevice = "/dev/disk/by-uuid/a55aed88-5155-4c6a-8508-34360cd1212a"; + swapDevices = [ { device = "/dev/disk/by-uuid/a55aed88-5155-4c6a-8508-34360cd1212a"; } ]; + boot.resumeDevice = "/dev/disk/by-uuid/a55aed88-5155-4c6a-8508-34360cd1212a"; - hardware.display = { - outputs."LVDS-1".edid = "1400x1050_60hz.bin"; - edid.enable = true; - edid.packages = [ - (pkgs.runCommand "edid-1400x1050-60hz" { } '' - mkdir -p "$out/lib/firmware/edid" - base64 -d > "$out/lib/firmware/edid/1400x1050_60hz.bin" <<'EOF' - AP///////wA15jcTAgAAABcZAQOAGRJ4469AlVZKjyUgUFQhCACQQAEAAQABAAEBAQEBAQEBwCd4yFAaCkAUdCUA9bgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAADwCQQzwAAAATAgAJ5QAAAAAA/gBIVjEyMVAwMS0xMDAKAJ4= - EOF - '') - ]; - }; + hardware.display = { + outputs."LVDS-1".edid = "1400x1050_60hz.bin"; + edid.enable = true; + edid.packages = [ + (pkgs.runCommand "edid-1400x1050-60hz" { } '' + mkdir -p "$out/lib/firmware/edid" + base64 -d > "$out/lib/firmware/edid/1400x1050_60hz.bin" <<'EOF' + AP///////wA15jcTAgAAABcZAQOAGRJ4469AlVZKjyUgUFQhCACQQAEAAQABAAEBAQEBAQEBwCd4yFAaCkAUdCUA9bgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAADwCQQzwAAAATAgAJ5QAAAAAA/gBIVjEyMVAwMS0xMDAKAJ4= + EOF + '') + ]; + }; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; - # networking.interfaces.wls3.useDHCP = lib.mkDefault true; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wls3.useDHCP = lib.mkDefault true; - nix.settings.system-features = [ "gccarch-core2" ]; - nixpkgs.hostPlatform.system = "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + nix.settings.system-features = [ "gccarch-core2" ]; + nixpkgs.hostPlatform.system = "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - environment.systemPackages = [ pkgs.intel-gpu-tools ]; + environment.systemPackages = [ pkgs.intel-gpu-tools ]; - powerManagement.enable = true; - services.thermald.enable = true; # intel thermal protection - services.thinkfan = { - enable = true; - levels = [ - [ - 0 - 0 - 55 - ] - [ - 1 - 40 - 50 - ] - [ - 2 - 45 - 55 - ] - [ - 3 - 50 - 60 - ] - [ - 6 - 55 - 65 - ] - [ - 7 - 60 - 75 - ] - [ - "level full-speed" - 70 - 85 - ] - [ - "level disengaged" - 80 - 32767 - ] - ]; - }; + powerManagement.enable = true; + services.thermald.enable = true; # intel thermal protection + services.thinkfan = { + enable = true; + levels = [ + [ + 0 + 0 + 55 + ] + [ + 1 + 40 + 50 + ] + [ + 2 + 45 + 55 + ] + [ + 3 + 50 + 60 + ] + [ + 6 + 55 + 65 + ] + [ + 7 + 60 + 75 + ] + [ + "level full-speed" + 70 + 85 + ] + [ + "level disengaged" + 80 + 32767 + ] + ]; + }; } diff --git a/hosts/yure/home.nix b/hosts/yure/home.nix index 519bde9..c418053 100644 --- a/hosts/yure/home.nix +++ b/hosts/yure/home.nix @@ -1,32 +1,31 @@ - { - osConfig, - config, - pkgs, - inputs, - lib, - ... + osConfig, + config, + pkgs, + inputs, + lib, + ... }: { - home.packages = [ - # (pkgs.callPackage ../yuhata/packages/brow6el.nix {}) - ]; - wayland.windowManager.niri.settings = { - layout.default-column-width.proportion = 1.; - }; - services.shikane = { - enable = true; - settings.profile = [ - { - name = "Undocked"; - output = [ - { - enable = true; - search = "n=LVDS-1"; - scale = 1.0; - } - ]; - } + home.packages = [ + # (pkgs.callPackage ../yuhata/packages/brow6el.nix {}) + ]; + wayland.windowManager.niri.settings = { + layout.default-column-width.proportion = 1.; + }; + services.shikane = { + enable = true; + settings.profile = [ + { + name = "Undocked"; + output = [ + { + enable = true; + search = "n=LVDS-1"; + scale = 1.0; + } ]; - }; + } + ]; + }; }