diff --git a/hosts/cap-nr200p/configuration.nix b/hosts/cap-nr200p/configuration.nix index fca8fab..162e6c6 100644 --- a/hosts/cap-nr200p/configuration.nix +++ b/hosts/cap-nr200p/configuration.nix @@ -13,7 +13,19 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + + # System Configuration + ../../modules/system/internationalization.nix + ../../modules/system/nix-settings.nix + + ../../modules/system/pipewire.nix + + # Application Groups ../../modules/application-groups/gaming.nix + + # Individual Applications + ../../modules/applications/firefox.nix + ../../modules/applications/thunar.nix ]; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; @@ -40,18 +52,13 @@ ''; # - nix.settings.download-buffer-size = 524288000; + # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; networking.hostName = "cap-nr200p"; # Define your hostname. #-# - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Enable networking networking.networkmanager.enable = true; @@ -69,33 +76,7 @@ # Set your time zone. time.timeZone = "America/Los_Angeles"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - # Enable the XFCE Desktop Environment. - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.desktopManager.xfce.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; # Enable CUPS to print documents. services.printing.enable = true; @@ -106,22 +87,6 @@ openFirewall = 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; - # 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; @@ -163,12 +128,6 @@ #services.xserver.displayManager.gdm.autoLogin.delay = 60; - # Install firefox. - programs.firefox.enable = true; # -# - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ @@ -275,12 +234,6 @@ bs-manager ]; - services.monado = { - enable = true; - defaultRuntime = true; - highPriority = true; - }; - services.hardware.openrgb.enable = true; services.meshcentral.enable = true; @@ -290,14 +243,6 @@ hardware.logitech.wireless.enable = true; hardware.logitech.wireless.enableGraphical = true; - services.sunshine = { - enable = true; - autoStart = true; - capSysAdmin = true; - openFirewall = true; - - }; - programs.bash.shellAliases = { nixrebuild = "pushd /etc/nixos && { trap 'popd' EXIT; sudo nixos-rebuild switch --flake .#$(hostname); }"; nixupdate = "cd /etc/nixos && sudo nix flake update && sudo nixos-rebuild switch --flake .#$(hostname)"; @@ -354,14 +299,6 @@ nerd-fonts.jetbrains-mono ]; - programs.thunar.enable = true; - programs.thunar.plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; - services.gvfs.enable = true; # Mount, trash, and other functionalities - services.tumbler.enable = true; # Thumbnail support for images - hardware.bluetooth.enable = true; # enables support for Bluetooth hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot services.blueman.enable = true; diff --git a/hosts/cap-slim7/configuration.nix b/hosts/cap-slim7/configuration.nix index f8dc85f..20458f3 100644 --- a/hosts/cap-slim7/configuration.nix +++ b/hosts/cap-slim7/configuration.nix @@ -8,25 +8,29 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + + # System Configuration + ../../modules/system/internationalization.nix + ../../modules/system/nix-settings.nix + + ../../modules/system/pipewire.nix + + # Application Groups ../../modules/application-groups/gaming.nix + + # Individual Applications + ../../modules/applications/firefox.nix + ../../modules/applications/thunar.nix ]; #boot.kernelPackages = pkgs.linuxPackages_latest; - # - nix.settings.download-buffer-size = 524288000; - # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.configurationLimit = 8; networking.hostName = "cap-slim7"; # Define your hostname. #-# - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; #security.sudo.extraConfig = '' # Defaults timestamp_timeout=15 @@ -57,53 +61,9 @@ #time.timeZone = "Europe/Oslo"; # services.tzupdate.enable = true; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - # Enable the X11 windowing system. - # services.xserver.enable = true; - - # Enable the XFCE Desktop Environment. - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.desktopManager.xfce.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - # 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; - # 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; @@ -124,12 +84,6 @@ ]; }; - # Install firefox. - programs.firefox.enable = true; # -# - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ @@ -248,21 +202,6 @@ ]; programs.ydotool.enable = true; - #boot.extraModulePackages = with config.boot.kernelPackages; [ - # v4l2loopback - #]; - #boot.extraModprobeConfig = '' - # options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - #''; - - #programs.virt-manager.enable = true; - #users.groups.libvirtd.members = [ "caperren" ]; - #virtualisation.libvirtd.enable = true; - #virtualisation.spiceUSBRedirection.enable = true; - #services.spice-vdagentd.enable = true; - - # services.automatic-timezoned.enable = true; - programs.bash.shellAliases = { nixrebuild = "pushd /etc/nixos && { trap 'popd' EXIT; sudo nixos-rebuild switch --flake .#$(hostname); }"; nixupdate = "cd /etc/nixos && sudo nix flake update && sudo nixos-rebuild switch --flake .#$(hostname)"; @@ -271,13 +210,6 @@ nixlimitfive = "sudo nix-env --list-generations --profile /nix/var/nix/profiles/system | head -n -5 | cut -d ' ' -f2 | xargs -I {} sudo nix-env --delete-generations --profile /nix/var/nix/profiles/system {}"; }; - #programs.appimage = { - # enable = true; - # binfmt = true; - #}; - - # services.power-profiles-daemon.enable = true; - services.tlp = { enable = true; settings = { @@ -363,14 +295,6 @@ nerd-fonts.jetbrains-mono ]; - programs.thunar.enable = true; - programs.thunar.plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; - services.gvfs.enable = true; # Mount, trash, and other functionalities - services.tumbler.enable = true; # Thumbnail support for images - hardware.bluetooth.enable = true; # enables support for Bluetooth hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot services.blueman.enable = true; diff --git a/modules/applications/firefox.nix b/modules/applications/firefox.nix new file mode 100644 index 0000000..345a7c8 --- /dev/null +++ b/modules/applications/firefox.nix @@ -0,0 +1,4 @@ +{ config, pkgs, ... }: +{ + programs.firefox.enable = true; +} diff --git a/modules/applications/steam.nix b/modules/applications/steam.nix index 0063f9a..1af18e6 100644 --- a/modules/applications/steam.nix +++ b/modules/applications/steam.nix @@ -1,7 +1,9 @@ { config, pkgs, ... }: { + # Support steam hardware like the index and steam controller hardware.steam-hardware.enable = true; + # Steam program itself programs.steam = { enable = true; remotePlay.openFirewall = true; @@ -9,9 +11,17 @@ gamescopeSession.enable = true; }; + # Valve's micro-compositor programs.gamescope = { enable = true; capSysNice = true; }; + # Open source OpenXR runtime for VR + services.monado = { + enable = true; + defaultRuntime = true; + highPriority = true; + }; + } diff --git a/modules/applications/thunar.nix b/modules/applications/thunar.nix new file mode 100644 index 0000000..fecbfaf --- /dev/null +++ b/modules/applications/thunar.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: +{ + programs.thunar.enable = true; + programs.thunar.plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + services.gvfs.enable = true; # Mount, trash, and other functionalities + services.tumbler.enable = true; # Thumbnail support for images +} diff --git a/modules/applications/xfce.nix b/modules/applications/xfce.nix new file mode 100644 index 0000000..f519bce --- /dev/null +++ b/modules/applications/xfce.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: +{ + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the XFCE Desktop Environment. + services.xserver.displayManager.lightdm.enable = true; + services.xserver.desktopManager.xfce.enable = true; + +} diff --git a/modules/system/internationalization.nix b/modules/system/internationalization.nix new file mode 100644 index 0000000..7e608bb --- /dev/null +++ b/modules/system/internationalization.nix @@ -0,0 +1,24 @@ +{ config, pkgs, ... }: +{ + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + +} diff --git a/modules/system/nix-settings.nix b/modules/system/nix-settings.nix new file mode 100644 index 0000000..dfd7fcb --- /dev/null +++ b/modules/system/nix-settings.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: +{ + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # Generally want a larger download buffer + nix.settings.download-buffer-size = 524288000; + +} diff --git a/modules/system/pipewire.nix b/modules/system/pipewire.nix new file mode 100644 index 0000000..2381f30 --- /dev/null +++ b/modules/system/pipewire.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: +{ + services.pulseaudio.enable = false; + + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +}