Compare commits

..

14 commits

Author SHA1 Message Date
Andre 4eb943d047 refactor(system): fix conflicts between desktop environment login managers
Some checks failed
Code Check / Run nixfmt and statix (push) Waiting to run
Code Check / Run nixfmt and statix (pull_request) Has been cancelled
2024-06-29 13:01:44 -04:00
Andre 64b2ff8d77 fix(system): fix namespacing in various modules 2024-06-29 13:01:44 -04:00
Andre dd04cac4ba fix(system): add initrd settings for tpm2 2024-06-29 13:01:44 -04:00
Andre 08ae068c37 chore: update video driver syntax to match upstream 2024-06-29 13:01:44 -04:00
Andre 73e33a1d95 chore: Simplify Nix config file in template 2024-06-29 13:01:44 -04:00
Andre cf3847efa3 bugfix: Remove lingering reference to auxlibs; Leave Totem in Gnome installs 2024-06-29 13:01:44 -04:00
Andre 6874673edf feat: Add Lix to new user template 2024-06-29 13:01:44 -04:00
Andre 8f94796401 chore: Cleanup template readme and options 2024-06-29 13:01:44 -04:00
Andre 6f3a935780 Fix funky unicode quotes 2024-06-29 13:01:44 -04:00
Andre 1873af7524 chore: Remove Aux Libs input 2024-06-29 13:01:44 -04:00
Andre f1df1a35bf feat: Add Flatpak support
chore: Prep for PR
2024-06-29 13:01:44 -04:00
Andre a2b1a8af4f feat(system): Add Nvidia, Intel, and AMD GPU support to new user template
chore(system): update top-level Readme file
2024-06-29 12:56:03 -04:00
Andre 4648af5704 chore: Change template namespace to 'aux.system' 2024-06-29 12:56:03 -04:00
Andre 79a9fda6b7 feat(system): add modules for bluetooth, networking, system config, Budgie, Hyprland, and XFCE to system template
fix(system): re-enable abort conditions in new user template
2024-06-29 12:54:47 -04:00
12 changed files with 81 additions and 49 deletions

View file

@ -116,7 +116,7 @@ in
# Enable the KDE desktop environment. # Enable the KDE desktop environment.
# https://kde.org/ # https://kde.org/
kde.enable = false; kde.useX11 = false;
# Enable the XFCE desktop environment. # Enable the XFCE desktop environment.
# https://xfce.org/ # https://xfce.org/

View file

@ -45,6 +45,13 @@ in
# Set up TPM if enabled. See https://nixos.wiki/wiki/TPM # Set up TPM if enabled. See https://nixos.wiki/wiki/TPM
(lib.mkIf (cfg.tpm2.enable) { (lib.mkIf (cfg.tpm2.enable) {
boot.initrd = {
# Enable systemd for TPM auto-unlocking
systemd.enable = true;
availableKernelModules = [ "tpm_crb" ];
kernelModules = [ "tpm_crb" ];
};
# After installing and rebooting, set it up via https://wiki.archlinux.org/title/Systemd-cryptenroll#Trusted_Platform_Module # After installing and rebooting, set it up via https://wiki.archlinux.org/title/Systemd-cryptenroll#Trusted_Platform_Module
environment.systemPackages = with pkgs; [ tpm2-tss ]; environment.systemPackages = with pkgs; [ tpm2-tss ];
security.tpm2 = { security.tpm2 = {

View file

@ -15,15 +15,12 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
boot.initrd.kernelModules = [ "amdgpu" ]; boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver = { services.xserver.videoDrivers = [ "amdgpu" ];
enable = true;
videoDrivers = [ "amdgpu" ];
};
hardware.opengl = { hardware.graphics = {
extraPackages = [ pkgs.amdvlk ]; extraPackages = [ pkgs.amdvlk ];
# 32-bit application compatibility # 32-bit application compatibility
driSupport32Bit = true; enable32Bit = true;
extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
}; };
}; };

View file

@ -19,7 +19,7 @@ in
environment.variables.VDPAU_DRIVER = "va_gl"; environment.variables.VDPAU_DRIVER = "va_gl";
hardware.opengl.extraPackages = with pkgs; [ hardware.graphics.extraPackages = with pkgs; [
( (
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel
@ -30,7 +30,7 @@ in
intel-media-driver intel-media-driver
]; ];
hardware.opengl.extraPackages32 = with pkgs.driversi686Linux; [ hardware.graphics.extraPackages32 = with pkgs.driversi686Linux; [
( (
if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11") then
vaapiIntel vaapiIntel

View file

@ -3,7 +3,6 @@
pkgs, pkgs,
config, config,
lib, lib,
inputs,
... ...
}: }:
let let
@ -19,6 +18,9 @@ in
}; };
}; };
config = { config = {
# Install the latest kernel
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
# Set up the environment # Set up the environment
environment = { environment = {
# Install base packages # Install base packages

View file

@ -35,7 +35,7 @@ in
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
# Reduce audio latency per https://wiki.nixos.org/wiki/PipeWire#Low-latency_setup # Reduce audio latency per https://nixos.wiki/wiki/PipeWire#Low-latency_setup
extraConfig.pipewire = lib.mkIf cfg.enableLowLatency { extraConfig.pipewire = lib.mkIf cfg.enableLowLatency {
"92-low-latency.conf" = { "92-low-latency.conf" = {
"context.properties" = { "context.properties" = {

View file

@ -16,17 +16,18 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; aux.system.ui.desktops = {
enable = true;
displayManager = lib.mkOptionDefault "lightdm";
};
services.xserver = { services.xserver = {
enable = true; enable = true;
desktopManager.budgie.enable = true; desktopManager.budgie.enable =
displayManager.lightdm.enable = lib.mkIf ( if config.services.xserver.desktopManager.gnome.enable then
!( builtins.abort "Budgie and Gnome cannot be enabled at the same time due to a bug. For details and a possible workaround, please see https://discourse.nixos.org/t/help-i-cant-have-pantheon-gnome-and-plasma-installed-on-my-system-at-the-same-time/47346"
config.services.xserver.displayManager.gdm.enable else
|| config.services.xserver.displayManager.sddm.enable true;
)
) true;
}; };
}; };
} }

View file

@ -21,13 +21,23 @@ in
variant = ""; variant = "";
}; };
}; };
displayManager = lib.mkOption {
description = "The display manager to use to start a desktop session.";
type = lib.types.enum [
"gdm"
"lightdm"
"sddm"
"sddm_wayland"
];
};
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.audio.enable = true; aux.system = {
bluetooth.enable = true;
hardware.bluetooth.enable = true; ui.audio.enable = true;
};
boot = { boot = {
# Enable Plymouth for graphical bootsplash. # Enable Plymouth for graphical bootsplash.
@ -37,7 +47,7 @@ in
}; };
# Add kernel parameters # Add kernel parameters
kernelParams = [ "quiet" "splash" ]; kernelParams = [ "quiet" ];
}; };
services = { services = {
@ -46,12 +56,23 @@ in
# Enable the X11 windowing system. # Enable the X11 windowing system.
enable = true; enable = true;
# Enable touchpad support (enabled by default in most desktop managers, buuuut just in case).
libinput.enable = true;
# Configure keymap in X11 # Configure keymap in X11
xkb = config.aux.system.ui.desktops.xkb; xkb = config.aux.system.ui.desktops.xkb;
# Set the display manager
displayManager = {
gdm.enable = (cfg.displayManager == "gdm");
lightdm.enable = (cfg.displayManager == "lightdm");
};
}; };
displayManager = {
sddm.enable = (cfg.displayManager == "sddm");
sddm.wayland.enable = (cfg.displayManager == "sddm_wayland");
};
# Enable touchpad support (enabled by default in most desktop managers, buuuut just in case).
libinput.enable = true;
}; };
# Support for AppImage files # Support for AppImage files

View file

@ -16,15 +16,17 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; aux.system.ui.desktops = {
enable = true;
displayManager = lib.mkOverride 500 "gdm";
};
# Enable Gnome # Enable Gnome
services.xserver = { services.xserver = {
# Remove default packages that came with the install # Remove default packages that came with the install
excludePackages = [ pkgs.xterm ]; excludePackages = [ pkgs.xterm ];
desktopManager.gnome.enable = true; desktopManager.gnome.enable = lib.mkDefault true;
displayManager.gdm.enable = true;
}; };
environment = { environment = {
@ -44,6 +46,9 @@ in
]; ];
}; };
# Manually set askPassword to avoid a conflict with KDE
programs.ssh.askPassword = "${pkgs.gnome.seahorse}/libexec/seahorse/ssh-askpass";
# Gnome UI integration for KDE apps # Gnome UI integration for KDE apps
qt = { qt = {
enable = true; enable = true;

View file

@ -18,7 +18,10 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; aux.system.ui.desktops = {
enable = true;
displayManager = if cfg.useX11 then lib.mkDefault "sddm" else lib.mkDefault "sddm_wayland";
};
programs.dconf.enable = true; programs.dconf.enable = true;
@ -30,18 +33,9 @@ in
}; };
services = { services = {
displayManager.sddm.enable = true;
desktopManager.plasma6.enable = true; desktopManager.plasma6.enable = true;
xserver.displayManager = lib.mkIf cfg.useX11 { xserver.displayManager = lib.mkIf cfg.useX11 { defaultSession = "plasmaX11"; };
defaultSession = "plasmaX11";
sddm.wayland.enable = lib.mkIf (
!(
config.services.xserver.displayManager.gdm.enable
|| config.services.xserver.displayManager.lightdm.enable
)
) true;
};
}; };
# Enable Gnome integration # Enable Gnome integration

View file

@ -16,15 +16,20 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
aux.system.ui.desktops.enable = true; aux.system.ui.desktops = {
services.xserver = {
enable = true; enable = true;
desktopManager = { displayManager = lib.mkOptionDefault "lightdm";
xterm.enable = false; };
xfce.enable = true;
}; services = {
displayManager.defaultSession = "xfce"; displayManager.defaultSession = "xfce";
xserver = {
enable = true;
desktopManager = {
xterm.enable = false;
xfce.enable = true;
};
};
}; };
}; };
} }

View file

@ -66,8 +66,8 @@ with lib;
aggregatedIcons = pkgs.buildEnv { aggregatedIcons = pkgs.buildEnv {
name = "system-icons"; name = "system-icons";
paths = with pkgs; [ paths = with pkgs; [
(lib.mkIf config.aux.system.ui.gnome.enable gnome.gnome-themes-extra) (lib.mkIf config.aux.system.ui.desktops.gnome.enable gnome.gnome-themes-extra)
(lib.mkIf config.aux.system.ui.kde.enable kdePackages.breeze-icons) (lib.mkIf config.aux.system.ui.desktops.kde.enable kdePackages.breeze-icons)
]; ];
pathsToLink = [ "/share/icons" ]; pathsToLink = [ "/share/icons" ];
}; };