From c91daf270f8517ceed1fdda9534d1a5caeb31ab6 Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Sun, 5 Apr 2026 18:26:54 +0200 Subject: [PATCH] gaming: new machine also move a lot of dev stuff into dev module from base --- flake.nix | 2 +- hosts/gaming/default.nix | 35 +++++++++++++++++++++++++ hosts/gaming/hardware-configuration.nix | 33 +++++++++++++++++++++++ modules/base.nix | 14 +--------- modules/dev/default.nix | 17 ++++++++++++ 5 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 hosts/gaming/default.nix create mode 100644 hosts/gaming/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index f1defa6..cbccf50 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ nixosConfigurations = { minipc = mkHost "minipc"; laptop = mkHost "laptop"; - # gaming = mkHost "gaming"; + gaming = mkHost "gaming"; }; }; } diff --git a/hosts/gaming/default.nix b/hosts/gaming/default.nix new file mode 100644 index 0000000..b177084 --- /dev/null +++ b/hosts/gaming/default.nix @@ -0,0 +1,35 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ + ./hardware-configuration.nix + ../../modules/base.nix + ../../modules/japanese.nix + ../../modules/gc.nix + ]; + + networking.hostName = "gaming"; + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; + + services.displayManager.sddm.enable = true; + services.desktopManager.plasma6.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; + }; + + environment.systemPackages = with pkgs; [ + git + ]; +} diff --git a/hosts/gaming/hardware-configuration.nix b/hosts/gaming/hardware-configuration.nix new file mode 100644 index 0000000..7c34270 --- /dev/null +++ b/hosts/gaming/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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 = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/99951f25-3e8a-4ee2-8f43-a6b543c6edce"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1957-159C"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/c08e2f60-2839-482c-b6fd-19ed0ac02be9"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/base.nix b/modules/base.nix index cda56e0..ddd9881 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -15,7 +15,6 @@ isNormalUser = true; description = "Fredrik Robertsen"; extraGroups = [ "networkmanager" "wheel" ]; - shell = pkgs.nushell; }; nixpkgs.config.allowUnfree = true; @@ -23,20 +22,9 @@ environment = { systemPackages = with pkgs; [ vim ripgrep xdg-utils ]; - shells = with pkgs; [ nushell bash ]; + shells = with pkgs; [ bash ]; }; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; - programs.bash.interactiveShellInit = '' - if [ "$TERM" = "dumb" ]; then exec ${pkgs.bash}; fi - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.nushell}/bin/nu $LOGIN_OPTION - fi - ''; - - services.openssh.enable = true; - services.gnome.gnome-keyring.enable = true; hardware.bluetooth.enable = true; programs.nix-ld.enable = true; diff --git a/modules/dev/default.nix b/modules/dev/default.nix index 8deeed2..9e67c96 100644 --- a/modules/dev/default.nix +++ b/modules/dev/default.nix @@ -35,5 +35,22 @@ ]; environment.sessionVariables.EDITOR = "hx"; + environment.shells = with pkgs; [ nushell bash ]; + + users.users.fredrikr.shell = pkgs.nushell; + + programs.bash.interactiveShellInit = '' + if [ "$TERM" = "dumb" ]; then exec ${pkgs.bash}; fi + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.nushell}/bin/nu $LOGIN_OPTION + fi + ''; + + programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + + services.openssh.enable = true; + services.gnome.gnome-keyring.enable = true; + }