From de3e7a2fb84d6afeffe874d17dfe187afcd22d00 Mon Sep 17 00:00:00 2001 From: schererleander Date: Wed, 30 Jul 2025 20:52:14 +0200 Subject: feat: add desktop configuration --- hosts/desktop/audio.nix | 11 ++++ hosts/desktop/configuration.nix | 101 ++++++++++++------------------- hosts/desktop/hardware-configuration.nix | 41 +++++++++++++ hosts/desktop/home.nix | 60 ++++++++++++++++++ hosts/desktop/wooting.nix | 46 ++++++-------- 5 files changed, 171 insertions(+), 88 deletions(-) create mode 100644 hosts/desktop/audio.nix create mode 100644 hosts/desktop/hardware-configuration.nix create mode 100644 hosts/desktop/home.nix (limited to 'hosts') diff --git a/hosts/desktop/audio.nix b/hosts/desktop/audio.nix new file mode 100644 index 0000000..e34b073 --- /dev/null +++ b/hosts/desktop/audio.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index d35102f..00011ff 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -1,70 +1,50 @@ -{ - pkgs, - ... -}: +{ pkgs, ... }: { + imports = [ ./hardware-configuration.nix + ./audio.nix + ./wooting.nix ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.consoleMode = "max"; - # Use latest kernel. + # Use latest kernel boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "nixos"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Graphics + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ + amdvlk + ]; + }; - # Enable networking - networking.networkmanager.enable = true; + environment.variables.AMD_VULKAN_ICD = "RADV"; - # Disable wait online + # Network + networking = { + hostName = "nixos"; + networkmanager.enable = true; + }; + + # Improve startup time systemd.services.NetworkManager-wait-online.enable = false; - # Set your time zone. + # Time time.timeZone = "Europe/Berlin"; - # Select internationalisation properties. - i18n.defaultLocale = "de_DE.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - - # Enable the KDE Plasma Desktop Environment. - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; - - # Configure console keymap + # Keymap console.keyMap = "de"; - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound with pipewire. - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - users.users.schererleander = { + # User + users.users.leander = { isNormalUser = true; - description = "schererleander"; extraGroups = [ "networkmanager" "wheel" @@ -73,24 +53,23 @@ ]; }; - programs.firefox.enable = true; - programs.steam.enable = true; + services = { + openssh.enable = true; + gnome.gnome-keyring.enable = true; + }; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; + security.polkit.enable = true; - environment.systemPackages = with pkgs; [ - neovim - git - ]; + programs.dconf.enable = true; - services.openssh.enable = true; + users.users.leander.shell = pkgs.zsh; + users.users.leander.ignoreShellProgramCheck = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - system.stateVersion = "25.05"; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + nixpkgs.config.allowUnfree = true; + system.stateVersion = "25.05"; } diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix new file mode 100644 index 0000000..9338f30 --- /dev/null +++ b/hosts/desktop/hardware-configuration.nix @@ -0,0 +1,41 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/9723eaab-4969-45e2-8364-b20aa6f4e120"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/29E6-B167"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/fb68b9c4-9305-4cf5-8279-3cae83524983"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp11s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix new file mode 100644 index 0000000..123c6f9 --- /dev/null +++ b/hosts/desktop/home.nix @@ -0,0 +1,60 @@ +{ pkgs, ... }: + +{ + imports = [ + ../../modules/home-manager + ]; + + home.username = "leander"; + home.homeDirectory = "/home/leander"; + + programs.home-manager.enable = true; + + home.packages = with pkgs; [ + obsidian + firefox + imv + mpv + + # fonts + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + ]; + + gtk = { + enable = true; + theme = { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = "Adwaita"; + package = pkgs.adwaita-icon-theme; + size = 24; + }; + + dev.enable = true; + + sway.enable = true; + waybar.enable = true; + foot.enable = true; + spicetify.enable = true; + zathura.enable = true; + nixcord.enable = true; + + home.stateVersion = "25.05"; +} diff --git a/hosts/desktop/wooting.nix b/hosts/desktop/wooting.nix index 3f446ba..742ef29 100644 --- a/hosts/desktop/wooting.nix +++ b/hosts/desktop/wooting.nix @@ -1,35 +1,27 @@ -{ - config, - lib, - pkgs, - ... -}: +{ pkgs, ... }: { - options.wooting.enable = lib.mkEnableOption "Enable Wooting udev rules"; - config = lib.mkIf config.wooting.enable { - services.udev.extraRules = '' - # Wooting One Legacy - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" + services.udev.extraRules = '' + # Wooting One Legacy + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", TAG+="uaccess" - # Wooting One update mode - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess" + # Wooting One update mode + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", TAG+="uaccess" - # Wooting Two Legacy - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" + # Wooting Two Legacy + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", TAG+="uaccess" - # Wooting Two update mode - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", TAG+="uaccess" + # Wooting Two update mode + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", TAG+="uaccess" - # Generic Wootings - SUBSYSTEM=="hidraw", ATTRS{idVendor}=="31e3", TAG+="uaccess" - SUBSYSTEM=="usb", ATTRS{idVendor}=="31e3", TAG+="uaccess" - ''; + # Generic Wootings + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="31e3", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="31e3", TAG+="uaccess" + ''; - environment.systemPackages = with pkgs; [ - wootility - ]; - }; + environment.systemPackages = with pkgs; [ + wootility + ]; } -- cgit v1.3.1