diff options
| -rw-r--r-- | flake.lock | 6 | ||||
| -rw-r--r-- | hosts/desktop/configuration.nix | 36 | ||||
| -rw-r--r-- | hosts/desktop/hardware-configuration.nix | 2 | ||||
| -rw-r--r-- | hosts/laptop/configuration.nix | 1 | ||||
| -rw-r--r-- | os/core/audio.nix | 56 | ||||
| -rw-r--r-- | os/core/drivers.nix | 1 | ||||
| -rw-r--r-- | os/srv/bluetooth.nix | 14 | ||||
| -rw-r--r-- | os/srv/srv.nix | 2 | ||||
| -rw-r--r-- | os/srv/zzz.nix | 19 |
9 files changed, 82 insertions, 55 deletions
@@ -232,11 +232,11 @@ ] }, "locked": { - "lastModified": 1767864335, - "narHash": "sha256-2L1hc/V2oHMVsAKxyCoSD0q5lL2ap7MR8pk9U2YB9gs=", + "lastModified": 1767898632, + "narHash": "sha256-ZpkiMJahNh5Xo1Lqxy2e2SEwyhWDwxrlv4zUO99OIrc=", "owner": "nix-community", "repo": "home-manager", - "rev": "af7f14ddf770e269bb67cea19708198e618b5c75", + "rev": "40deed4ffe019874309b3eef429e4830346b0aa9", "type": "github" }, "original": { diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index ecef098..e09c622 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -14,12 +14,14 @@ allowUnfree.enable = true; flatpak.enable = true; - audio.enable = true; + audio = { + enable = true; + disable-devices.enable = true; + }; bootloader = "systemd-boot"; drivers = { enable = true; amdgpu.enable = true; - stability = "stable"; }; fonts.enable = true; greet.enable = true; @@ -60,6 +62,8 @@ kvm.enable = true; nix-helper.enable = true; ollama.enable = true; + bluetooth.enable = true; + zzz.enable = true; }; wm = { enable = true; @@ -67,16 +71,6 @@ }; }; - environment.systemPackages = with pkgs; [ - rivalcfg - ]; - - services.blueman.enable = true; - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - boot = { kernelParams = [ "video=DP-1:2560x1440@240" ]; kernelModules = [ "nct6687" ]; @@ -84,22 +78,4 @@ config.boot.kernelPackages.nct6687d ]; }; - services.pipewire.wireplumber.extraConfig."99-disable-useless-devices"."monitor.alsa.rules" = [{ - matches = [ - { "device.name" = "~alsa_card.pci-0000_03_00.1*"; } - { "device.description" = "~USB Audio*"; } - ]; - actions.update-props = { "device.disabled" = true; }; - }]; - - systemd.user.services.zzz-presence = { - description = "Zenless Zone Zero Discord Rich Presence"; - wantedBy = [ "default.target" ]; - - serviceConfig = { - ExecStart = "${pkgs.python3.withPackages (ps: [ ps.pypresence ])}/bin/python3 /etc/nixos/resources/zzz.py"; - Restart = "always"; - RestartSec = "10"; - }; - }; } diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index e2d32f6..be7bbdc 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -31,7 +31,7 @@ options = [ "noatime" ]; }; - fileSystems."/run/media/adam/hdd" = + fileSystems."/storage" = { device = "/dev/disk/by-uuid/c0dc7c4d-1800-4c84-a04c-5ea7f5e86c4b"; fsType = "ext4"; options = [ "nofail" "noatime" ]; diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 6435e79..d790d57 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -39,6 +39,7 @@ users.enable = true; }; srv = { + bluetooth.enable = true; files = { thunar.enable = true; utils.enable = true; diff --git a/os/core/audio.nix b/os/core/audio.nix index 8d44375..0290b6c 100644 --- a/os/core/audio.nix +++ b/os/core/audio.nix @@ -3,27 +3,41 @@ let cfg = config.os.core.audio; in { - options.os.core.audio.enable = lib.mkEnableOption "audio support"; - config = lib.mkIf cfg.enable { - services = { - pipewire = { - enable = true; - audio.enable = true; - pulse.enable = true; - alsa.enable = true; - alsa.support32Bit = true; - jack.enable = true; - wireplumber.enable = true; + options.os.core.audio = { + enable = lib.mkEnableOption "audio support"; + disable-devices.enable = lib.mkEnableOption "disables some random devices cluttering up"; + }; + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + services = { + pipewire = { + enable = true; + audio.enable = true; + pulse.enable = true; + alsa.enable = true; + alsa.support32Bit = true; + jack.enable = true; + wireplumber.enable = true; + }; + playerctld.enable = true; + spotifyd.enable = true; }; - playerctld.enable = true; - spotifyd.enable = true; - }; - security.rtkit.enable = true; - hardware.enableAllFirmware = true; + security.rtkit.enable = true; + hardware.enableAllFirmware = true; - environment.systemPackages = with pkgs; [ - helvum - alsa-utils - ]; - }; + environment.systemPackages = with pkgs; [ + helvum + alsa-utils + ]; + }) + (lib.mkIf cfg.disable-devices.enable { + services.pipewire.wireplumber.extraConfig."99-disable-useless-devices"."monitor.alsa.rules" = [{ + matches = [ + { "device.name" = "~alsa_card.pci-0000_03_00.1*"; } + { "device.description" = "~USB Audio*"; } + ]; + actions.update-props = { "device.disabled" = true; }; + }]; + }) + ]; } diff --git a/os/core/drivers.nix b/os/core/drivers.nix index 57f370a..8c22940 100644 --- a/os/core/drivers.nix +++ b/os/core/drivers.nix @@ -26,6 +26,7 @@ in rocmPackages.clr.icd ]; }; + environment.systemPackages = [ pkgs.rivalcfg ]; } (lib.mkIf cfg.amdgpu.enable { diff --git a/os/srv/bluetooth.nix b/os/srv/bluetooth.nix new file mode 100644 index 0000000..a803c55 --- /dev/null +++ b/os/srv/bluetooth.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: +let + cfg = config.os.srv.bluetooth; +in +{ + options.os.srv.bluetooth.enable = lib.mkEnableOption "enables bluetooth support"; + config = lib.mkIf cfg.enable { + services.blueman.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + }; +} diff --git a/os/srv/srv.nix b/os/srv/srv.nix index 19e959e..f9280ab 100644 --- a/os/srv/srv.nix +++ b/os/srv/srv.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./bluetooth.nix ./compat.nix ./docker.nix ./files.nix @@ -8,5 +9,6 @@ ./kvm.nix ./nix-helper.nix ./ollama.nix + ./zzz.nix ]; } diff --git a/os/srv/zzz.nix b/os/srv/zzz.nix new file mode 100644 index 0000000..cd9a67e --- /dev/null +++ b/os/srv/zzz.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.os.srv.zzz; +in +{ + options.os.srv.zzz.enable = lib.mkEnableOption "enables the zzz rpc service"; + config = lib.mkIf cfg.enable { + systemd.user.services.zzz-presence = { + description = "Zenless Zone Zero Discord Rich Presence"; + wantedBy = [ "default.target" ]; + + serviceConfig = { + ExecStart = "${pkgs.python3.withPackages (ps: [ ps.pypresence ])}/bin/python3 /etc/nixos/resources/zzz.py"; + Restart = "always"; + RestartSec = "10"; + }; + }; + }; +} |
