From f31c1ae0e0bc8e546e3971d6eb1e67ecb98b08ef Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Sun, 4 Feb 2024 15:00:18 +0100 Subject: [PATCH] refactor: audio.nix --- modules/audio.nix | 33 +++++++++++++++++++++++++++ modules/gnome-base.nix | 52 ++++++++++++++++-------------------------- 2 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 modules/audio.nix diff --git a/modules/audio.nix b/modules/audio.nix new file mode 100644 index 0000000..e45e8e0 --- /dev/null +++ b/modules/audio.nix @@ -0,0 +1,33 @@ +{ lib, config, options, pkgs, modulesPath, ... }: +#with lib; +#let +# cfg = config.yoda.audio; +#in +#{ +# options = { +# yoda.audio = { +# enable = mkEnableOption "Sound with pipewire"; +# }; +# }; +# +# config = mkIf cfg.enable +{ + # Enable sound with pipewire. + # https://github.com/tolgaerok/nixos-kde/blob/main/core/system/audio/default.nix + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this. + #jack.enable = true; + + # Use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; +#}; +} diff --git a/modules/gnome-base.nix b/modules/gnome-base.nix index d557311..4da4ca5 100644 --- a/modules/gnome-base.nix +++ b/modules/gnome-base.nix @@ -1,5 +1,25 @@ { config, pkgs, ... }: { + # GNOME desktop environment. + # If the theme or other settings are broken after switching to GNOME from e.g. KDE, resetting settings can help: + # dconf reset -f / && reboot + # See also: kde.nix + + imports = [ + ./audio.nix + ]; + + # Enable the X11 windowing system. + services.xserver.enable = true; + # Exclude xterm. + services.xserver.excludePackages = [ pkgs.xterm ]; + + # Enable the GNOME desktop environment. + services.xserver.displayManager.gdm.enable = true; + # Toggles, weather the Wayland or X11 GNOME session is started. + services.xserver.displayManager.gdm.wayland = false; + services.xserver.desktopManager.gnome.enable = true; + # Don't install all programs of the GNOME desktop. # https://nixos.wiki/wiki/GNOME#Excluding_some_GNOME_applications_from_the_default_install environment.gnome.excludePackages = (with pkgs; [ @@ -19,43 +39,11 @@ gnome.gnome-system-monitor # Resource monitor / task manager gnome.totem # Video player ]); - # GNOME Calendar comes preinstalled. https://nixos.wiki/wiki/GNOME/Calendar - # Enable the X11 windowing system. - services.xserver.enable = true; - # Exclude xterm. - services.xserver.excludePackages = [ pkgs.xterm ]; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - # Toggles, weather the Wayland or X11 GNOME session is started. - services.xserver.displayManager.gdm.wayland = false; - services.xserver.desktopManager.gnome.enable = true; - # Configure keymap in X11. services.xserver = { layout = "de"; xkbVariant = "nodeadkeys"; }; - - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this. - #jack.enable = true; - - # Use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.enable = true; - }; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; }