diff --git a/common/base-graphical/default.nix b/common/base-graphical/default.nix new file mode 100644 index 0000000..1ef5c98 --- /dev/null +++ b/common/base-graphical/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.qenya.base-graphical; +in +{ + imports = [ + ./sound.nix + ]; + + options.qenya.base-graphical.enable = mkEnableOption "Base configuration for graphical environments"; + + config = mkIf cfg.enable { + services.xserver.enable = true; + }; +} diff --git a/common/base-graphical/sound.nix b/common/base-graphical/sound.nix new file mode 100644 index 0000000..bb0c847 --- /dev/null +++ b/common/base-graphical/sound.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.qenya.base-graphical; +in +{ + config = mkIf cfg.enable { + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + hardware.pulseaudio.enable = false; # this theoretically defaults to false but something else seems to be flipping it + environment.systemPackages = with pkgs; [ helvum ]; # patchbay + }; +} diff --git a/common/default.nix b/common/default.nix index e380932..fd0791c 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./base-graphical ./base-server ./users ./environment.nix diff --git a/hosts/kilgharrah/default.nix b/hosts/kilgharrah/default.nix index 3a834fb..bafc19d 100644 --- a/hosts/kilgharrah/default.nix +++ b/hosts/kilgharrah/default.nix @@ -6,7 +6,6 @@ ./filesystems.nix ./hardware.nix ./networking.nix - ./sound.nix ]; nixpkgs.hostPlatform = "x86_64-linux"; @@ -17,12 +16,13 @@ targetHost = null; # disallow remote deployment }; + qenya.base-graphical.enable = true; + time.timeZone = "Europe/London"; i18n.defaultLocale = "en_GB.UTF-8"; console.keyMap = "uk"; - services.xserver.enable = true; services.displayManager.sddm.enable = true; services.displayManager.sddm.wayland.enable = true; services.desktopManager.plasma6.enable = true; diff --git a/hosts/kilgharrah/sound.nix b/hosts/kilgharrah/sound.nix deleted file mode 100644 index cb97bd4..0000000 --- a/hosts/kilgharrah/sound.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - environment.systemPackages = with pkgs; [ helvum ]; # patchbay -} \ No newline at end of file diff --git a/hosts/tohru/default.nix b/hosts/tohru/default.nix index c8d2ec3..7373dd5 100644 --- a/hosts/tohru/default.nix +++ b/hosts/tohru/default.nix @@ -18,25 +18,19 @@ targetHost = null; # disallow remote deployment }; + qenya.base-graphical.enable = true; + time.timeZone = "Europe/London"; i18n.defaultLocale = "en_GB.UTF-8"; console.keyMap = "uk"; - services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; services.xserver.xkb.layout = "gb"; services.printing.enable = true; - sound.enable = true; - hardware.pulseaudio.enable = true; - # services.pipewire = { - # enable = true; - # pulse.enable = true; - # }; - age.secrets.user-password-tohru-qenya.file = ../../secrets/user-password-tohru-qenya.age; users.users.qenya.hashedPasswordFile = config.age.secrets.user-password-tohru-qenya.path; users.users.qenya.extraGroups = [