diff --git a/provision/hosts/kestrel/configuration.nix b/provision/hosts/kestrel/configuration.nix index 24db4373..560e5cd4 100644 --- a/provision/hosts/kestrel/configuration.nix +++ b/provision/hosts/kestrel/configuration.nix @@ -36,6 +36,7 @@ desktop = { enable = true; gnome.enable = true; + peripherals.enable = true; }; devel = { engineering.enable = true; @@ -50,6 +51,7 @@ beancount.enable = true; chezmoi.apply = true; kitty.enable = true; + virt-manager.enable = true; syncthing = { enable = true; keyPath = ../../secrets/syncthing/kestrel/key.pem.age; @@ -60,9 +62,7 @@ }; }; services = { - peripherals.enable = true; samba-client.enable = true; - virt-manager.enable = true; }; system = { backup.enable = true; diff --git a/provision/hosts/osprey/configuration.nix b/provision/hosts/osprey/configuration.nix index ca05f9eb..f2de722d 100644 --- a/provision/hosts/osprey/configuration.nix +++ b/provision/hosts/osprey/configuration.nix @@ -33,15 +33,15 @@ desktop = { enable = true; gnome.enable = true; + peripherals.enable = true; }; programs = { chezmoi.apply = true; kitty.enable = true; + virt-manager.enable = true; }; services = { - peripherals.enable = true; samba-client.enable = true; - virt-manager.enable = true; }; system = { ssh.enable = true; diff --git a/provision/hosts/shivan/configuration.nix b/provision/hosts/shivan/configuration.nix index e982e3f2..f7a317e6 100644 --- a/provision/hosts/shivan/configuration.nix +++ b/provision/hosts/shivan/configuration.nix @@ -23,6 +23,7 @@ desktop = { enable = true; gnome.enable = true; + peripherals.enable = true; }; devel = { engineering.enable = true; @@ -31,11 +32,10 @@ programs = { kitty.enable = true; chezmoi.apply = true; + virt-manager.enable = false; }; services = { - peripherals.enable = true; samba-client.enable = true; - virt-manager.enable = false; }; system = { ssh.enable = true; diff --git a/provision/modules/desktop/default.nix b/provision/modules/desktop/default.nix index c08eb9cf..bf8ebb12 100644 --- a/provision/modules/desktop/default.nix +++ b/provision/modules/desktop/default.nix @@ -6,6 +6,7 @@ in { ./kde-connect.nix ./keyd.nix ./gnome.nix + ./peripherals.nix ]; options.modules.desktop.enable = lib.mkEnableOption "desktop"; diff --git a/provision/modules/desktop/peripherals.nix b/provision/modules/desktop/peripherals.nix new file mode 100644 index 00000000..b13f0ae1 --- /dev/null +++ b/provision/modules/desktop/peripherals.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, user, ... }: + +let cfg = config.modules.desktop.peripherals; +in { + options.modules.desktop.peripherals.enable = lib.mkEnableOption "peripherals"; + config = lib.mkIf cfg.enable { + services.usbmuxd.enable = true; # for iOS mounting as storage + environment.systemPackages = with pkgs; [ + libimobiledevice # Library to support iPhone, iPod Touch and iPad devices on Linux + ifuse # fuse filesystem implementation to access the contents of iOS devices + pySVS # control SVS subwoofers from the command-line + ]; + }; +} diff --git a/provision/modules/programs/default.nix b/provision/modules/programs/default.nix index b44a6d09..a9bebcef 100644 --- a/provision/modules/programs/default.nix +++ b/provision/modules/programs/default.nix @@ -9,6 +9,7 @@ ./kitty.nix ./nvim.nix ./syncthing.nix + ./virt-manager.nix ./yt-dlp.nix ]; } diff --git a/provision/modules/services/virt-manager.nix b/provision/modules/programs/virt-manager.nix similarity index 73% rename from provision/modules/services/virt-manager.nix rename to provision/modules/programs/virt-manager.nix index b1c53d4f..845ac710 100644 --- a/provision/modules/services/virt-manager.nix +++ b/provision/modules/programs/virt-manager.nix @@ -1,13 +1,13 @@ { config, lib, pkgs, ... }: -let cfg = config.modules.services.virt-manager; +let cfg = config.modules.programs.virt-manager; in { - options.modules.services.virt-manager.enable = lib.mkEnableOption "virt-manager"; + options.modules.programs.virt-manager.enable = lib.mkEnableOption "virt-manager"; config = lib.mkIf cfg.enable { - virtualisation.libvirtd.enable = true; - programs.dconf.enable = true; environment.systemPackages = with pkgs; [ virt-manager # Desktop application for managing virtual machines through libvirt. ]; + virtualisation.libvirtd.enable = true; + programs.dconf.enable = true; }; } diff --git a/provision/modules/services/default.nix b/provision/modules/services/default.nix index 95f8f298..6dcc5867 100644 --- a/provision/modules/services/default.nix +++ b/provision/modules/services/default.nix @@ -1,4 +1,6 @@ { ... }: { - imports = [ ./peripherals.nix ./samba-client.nix ./virt-manager.nix ]; + imports = [ + ./samba-client.nix + ]; } diff --git a/provision/modules/services/peripherals.nix b/provision/modules/services/peripherals.nix deleted file mode 100644 index 96a3abc7..00000000 --- a/provision/modules/services/peripherals.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, user, ... }: - -let cfg = config.modules.services.peripherals; -in { - options.modules.services.peripherals.enable = lib.mkEnableOption "peripherals"; - config = lib.mkIf cfg.enable { - - services.usbmuxd.enable = true; # for iOS mounting as storage - environment.systemPackages = with pkgs; [ - pulseaudio # Sound server for Linux and other Unix-like operating systems. - pavucontrol # Simple GTK based mixer for the PulseAudio sound server - libimobiledevice # Library to support iPhone, iPod Touch and iPad devices on Linux - ifuse # fuse filesystem implementation to access the contents of iOS devices - usbtop - pySVS # control SVS subwoofers from the command-line - ]; - - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - }; -} diff --git a/provision/modules/services/samba-client.nix b/provision/modules/services/samba-client.nix index e4249c61..a75f4b57 100644 --- a/provision/modules/services/samba-client.nix +++ b/provision/modules/services/samba-client.nix @@ -4,14 +4,11 @@ let cfg = config.modules.services.samba-client; in { options.modules.services.samba-client.enable = lib.mkEnableOption "samba-client"; config = lib.mkIf cfg.enable { - - # the needed ports in the firewall. - networking.firewall.allowedTCPPorts = [ 445 139 ]; - networking.firewall.allowedUDPPorts = [ 137 138 ]; - - # To make SMB mounting easier on the command line environment.systemPackages = with pkgs; [ cifs-utils # Utilities for mounting and managing CIFS (Common Internet File System) shares. ]; + + networking.firewall.allowedTCPPorts = [ 445 139 ]; + networking.firewall.allowedUDPPorts = [ 137 138 ]; }; }