diff --git a/configuration.nix b/configuration.nix index 7d2131d..26df30e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,11 +7,7 @@ imports = [ ./hardware-configuration.nix ./packages.nix - ./modules/nfs.nix - ./modules/navidrome.nix - ./modules/slskd.nix - ./modules/smb.nix - ./modules/scripts.nix + ./modules ]; nix.settings.experimental-features = [ @@ -29,44 +25,6 @@ fsType = "ext4"; }; - boot.loader.grub = { - enable = true; - zfsSupport = true; - efiSupport = true; - efiInstallAsRemovable = true; - mirroredBoots = [ - { - devices = [ "nodev" ]; - path = "/boot"; - } - ]; - }; - - fileSystems."/" = { - device = "zpool/root"; - fsType = "zfs"; - }; - fileSystems."/nix" = { - device = "zpool/nix"; - fsType = "zfs"; - }; - fileSystems."/var" = { - device = "zpool/var"; - fsType = "zfs"; - }; - fileSystems."/home" = { - device = "zpool/home"; - fsType = "zfs"; - }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/FCFD-4472"; - fsType = "vfat"; - }; - boot.zfs.forceImportRoot = false; - services.zfs.autoScrub.enable = true; - - swapDevices = [ ]; - networking.hostId = "6054e036"; networking.hostName = "nixos-music"; networking.networkmanager.enable = true; @@ -125,33 +83,5 @@ }; }; - systemd.timers."bc-wishlist-scraper" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "daily"; - Unit = "bc-wishlist-scraper.service"; - }; - }; - - systemd.services."bc-wishlist-scraper" = { - script = '' - ${pkgs.bash}/bin/bash /home/user/bc-wishlist-scraper/run.sh - ''; - }; - - systemd.user.timers."scdl" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "daily"; - Unit = "scdl.service"; - }; - }; - - systemd.user.services."scdl" = { - script = '' - cd ~/Music/scdl && ${pkgs.scdl}/bin/scdl me -f -c --download-archive archive.txt - ''; - }; - system.stateVersion = "26.05"; } diff --git a/home-manager/beets.nix b/home-manager/beets.nix index 55c32c7..1ed2393 100644 --- a/home-manager/beets.nix +++ b/home-manager/beets.nix @@ -11,8 +11,14 @@ programs.beets.settings = { directory = "/home/user/Music/Tracks"; - - plugins = [ "fetchart" "badfiles" "edit" "fish" "hook" ]; + + plugins = [ + "fetchart" + "badfiles" + "edit" + "fish" + "hook" + ]; import = { copy = false; diff --git a/home-manager/home.nix b/home-manager/home.nix index 8c6c91e..89a5fcc 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,4 +1,4 @@ -{pkgs, config, ... }: +{ pkgs, config, ... }: { imports = [ ./beets.nix diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..2af688e --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./slskd.nix + ./navidrome.nix + ./nfs.nix + ./scripts.nix + ./services.nix + ./smb.nix + ./zfs.nix + ]; +} diff --git a/modules/navidrome.nix b/modules/navidrome.nix index 90ce810..a70f05a 100644 --- a/modules/navidrome.nix +++ b/modules/navidrome.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: { services.navidrome = { diff --git a/modules/services.nix b/modules/services.nix new file mode 100644 index 0000000..eeb0bf3 --- /dev/null +++ b/modules/services.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +{ + systemd.timers."bc-wishlist-scraper" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Unit = "bc-wishlist-scraper.service"; + }; + }; + + systemd.services."bc-wishlist-scraper" = { + script = '' + ${pkgs.bash}/bin/bash /home/user/bc-wishlist-scraper/run.sh + ''; + }; + + systemd.user.timers."scdl" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Unit = "scdl.service"; + }; + }; + + systemd.user.services."scdl" = { + script = '' + cd ~/Music/scdl && ${pkgs.scdl}/bin/scdl me -f -c --download-archive archive.txt + ''; + }; +} diff --git a/modules/slskd.nix b/modules/slskd.nix index ed25308..a99f2df 100644 --- a/modules/slskd.nix +++ b/modules/slskd.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: +{ pkgs, ... }: { services.slskd = { diff --git a/modules/zfs.nix b/modules/zfs.nix new file mode 100644 index 0000000..cca2052 --- /dev/null +++ b/modules/zfs.nix @@ -0,0 +1,39 @@ +{ + boot.loader.grub = { + enable = true; + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + mirroredBoots = [ + { + devices = [ "nodev" ]; + path = "/boot"; + } + ]; + }; + + fileSystems."/" = { + device = "zpool/root"; + fsType = "zfs"; + }; + fileSystems."/nix" = { + device = "zpool/nix"; + fsType = "zfs"; + }; + fileSystems."/var" = { + device = "zpool/var"; + fsType = "zfs"; + }; + fileSystems."/home" = { + device = "zpool/home"; + fsType = "zfs"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/FCFD-4472"; + fsType = "vfat"; + }; + boot.zfs.forceImportRoot = false; + services.zfs.autoScrub.enable = true; + + swapDevices = [ ]; +} diff --git a/packages.nix b/packages.nix index 56d5ae3..962412d 100644 --- a/packages.nix +++ b/packages.nix @@ -1,22 +1,30 @@ { pkgs, ... }: { - environment.systemPackages = (with pkgs; [ - wget - nixfmt - tree-sitter - lsof - exiftool - trash-cli - ffmpeg - unzip - scdl - aria2 - nodejs - gomi - bun - croc - mp3val - flac - (python314.withPackages(ps: with ps; [ requests python-dotenv ])) - ]); + environment.systemPackages = ( + with pkgs; + [ + wget + nixfmt + tree-sitter + lsof + exiftool + trash-cli + ffmpeg + unzip + scdl + aria2 + nodejs + gomi + bun + croc + mp3val + flac + (python314.withPackages ( + ps: with ps; [ + requests + python-dotenv + ] + )) + ] + ); }