diff --git a/nixos/mirai/configuration.nix b/nixos/mirai/configuration.nix index 58498126..760b3c85 100644 --- a/nixos/mirai/configuration.nix +++ b/nixos/mirai/configuration.nix @@ -7,7 +7,7 @@ imports = [ # Include the results of the hardware scan. ./mirai.nix - ./docker.nix + ./services.nix ]; security.sudo.wheelNeedsPassword = false; @@ -37,8 +37,9 @@ users.users.fs0c131y = { isNormalUser = true; - extraGroups = ["wheel" "docker"]; + extraGroups = ["wheel" "docker" "media"]; }; + users.groups.media = {}; nixpkgs.config.allowUnfree = true; networking.hostName = "mirai"; # Define your hostname. diff --git a/nixos/mirai/mirai.nix b/nixos/mirai/mirai.nix index 5f377d53..1020eac5 100644 --- a/nixos/mirai/mirai.nix +++ b/nixos/mirai/mirai.nix @@ -1,30 +1,39 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci"]; + boot.initrd.kernelModules = ["dm-snapshot"]; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/8f805d1b-a469-4db8-9ee1-b98ea220714a"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/8f805d1b-a469-4db8-9ee1-b98ea220714a"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D840-A590"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D840-A590"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = [ ]; + fileSystems."/media" = { + device = "/dev/disk/by-uuid/cad22fc7-08d2-4650-8d5e-a101e3fd1bd1"; + fsType = "ext4"; + }; + + swapDevices = []; # 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 diff --git a/nixos/mirai/services.nix b/nixos/mirai/services.nix new file mode 100644 index 00000000..409f2786 --- /dev/null +++ b/nixos/mirai/services.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + ... +}: { + services.navidrome = { + enable = true; + settings = { + MusicFolder = "/media/music"; + }; + }; + services.caddy = { + enable = true; + virtualHosts."navidrome.darksailor.dev".extraConfig = '' + reverse_proxy localhost:4533 + ''; + }; +}