From a54522f072ed9d957e64fffd6477581429c31452 Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Wed, 28 May 2025 18:16:25 -0400 Subject: [PATCH] Init configs for Haze host --- home/hosts/haze/config/dconf.nix | 41 +++++++++++ home/hosts/haze/config/default.nix | 8 +++ home/hosts/haze/config/monitors.xml | 2 + home/hosts/haze/default.nix | 31 +++++++++ hosts/nixos/haze/config/default.nix | 4 ++ hosts/nixos/haze/default.nix | 75 +++++++++++++++++++++ hosts/nixos/haze/hardware.nix | 101 ++++++++++++++++++++++++++++ 7 files changed, 262 insertions(+) create mode 100644 home/hosts/haze/config/dconf.nix create mode 100644 home/hosts/haze/config/default.nix create mode 100644 home/hosts/haze/config/monitors.xml create mode 100644 home/hosts/haze/default.nix create mode 100644 hosts/nixos/haze/config/default.nix create mode 100644 hosts/nixos/haze/default.nix create mode 100644 hosts/nixos/haze/hardware.nix diff --git a/home/hosts/haze/config/dconf.nix b/home/hosts/haze/config/dconf.nix new file mode 100644 index 0000000..ff8e617 --- /dev/null +++ b/home/hosts/haze/config/dconf.nix @@ -0,0 +1,41 @@ +# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix +{ lib, ... }: + +with lib.hm.gvariant; + +{ + dconf.settings = { + "org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = [ + "user-theme@gnome-shell-extensions.gcampax.github.com" + "dash-in-panel@fthx" + "AlphabeticalAppGrid@stuarthayhurst" + "color-picker@tuberry" + "monitor-brightness-volume@ailin.nemui" + "quicksettings-audio-devices-renamer@marcinjahn.com" + "Vitals@CoreCoding.com" + "appindicatorsupport@rgcjonas.gmail.com" + "paperwm@paperwm.github.com" + "just-perfection-desktop@just-perfection" + "pano@elhan.io" + "blur-my-shell@aunetx" + "quicksettings-audio-devices-hider@marcinjahn.com" + "undecorate@sun.wxg@gmail.com" + ]; + favorite-apps = [ + "com.mitchellh.ghostty.desktop" + "org.gnome.Nautilus.desktop" + "win11.desktop" + "zen.desktop" + "code.desktop" + "spotify.desktop" + "discord.desktop" + "org.telegram.desktop.desktop" + "steam.desktop" + "Ryujinx.desktop" + "Marvel Rivals.desktop" + ]; + last-selected-power-profile = "performance"; + }; +} diff --git a/home/hosts/haze/config/default.nix b/home/hosts/haze/config/default.nix new file mode 100644 index 0000000..fd7ee5f --- /dev/null +++ b/home/hosts/haze/config/default.nix @@ -0,0 +1,8 @@ +{ + # home.file.".config/monitors_source" = { + # source = ./monitors.xml; + # onChange = '' + # cp $HOME/.config/monitors_source $HOME/.config/monitors.xml + # ''; + # }; +} diff --git a/home/hosts/haze/config/monitors.xml b/home/hosts/haze/config/monitors.xml new file mode 100644 index 0000000..fa4090a --- /dev/null +++ b/home/hosts/haze/config/monitors.xml @@ -0,0 +1,2 @@ + + diff --git a/home/hosts/haze/default.nix b/home/hosts/haze/default.nix new file mode 100644 index 0000000..1e3f278 --- /dev/null +++ b/home/hosts/haze/default.nix @@ -0,0 +1,31 @@ +{ + lib, + pkgs, + ... +}: +{ + imports = lib.flatten [ + ## Common Imports ## + (map lib.custom.relativeToRoot [ + "home/global/common/browsers" + "home/global/common/gaming" + "home/global/common/gnome" + "home/global/common/vscode" + "home/global/common/xdg.nix" + ]) + + ## VM Specific ## + ./config + ]; + + ## Packages with no needed configs ## + home.packages = builtins.attrValues { + inherit (pkgs) + ## Media ## + cider # Apple Music + + ## Tools ## + inspector + ; + }; +} diff --git a/hosts/nixos/haze/config/default.nix b/hosts/nixos/haze/config/default.nix new file mode 100644 index 0000000..b23287b --- /dev/null +++ b/hosts/nixos/haze/config/default.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + imports = lib.custom.scanPaths ./.; +} diff --git a/hosts/nixos/haze/default.nix b/hosts/nixos/haze/default.nix new file mode 100644 index 0000000..67da700 --- /dev/null +++ b/hosts/nixos/haze/default.nix @@ -0,0 +1,75 @@ +############################################################### +# +# Rune - Main Desktop +# NixOS running on Ryzen 9 7900X3D , Radeon RX 6950 XT, 32GB RAM +# +############################################################### + +{ + inputs, + lib, + config, + pkgs, + ... +}: +let + username = "cesar"; + user = config.secretsSpec.users.${username}; +in +{ + imports = lib.flatten [ + ## Rune Only ## + inputs.chaotic.nixosModules.default + # ./config + + ## Hardware ## + ./hardware.nix + inputs.hardware.nixosModules.common-cpu-amd + inputs.hardware.nixosModules.common-gpu-amd + inputs.hardware.nixosModules.common-pc-ssd + + (map lib.custom.relativeToRoot [ + ## Required Configs ## + "hosts/global/core" + + ## Optional Configs ## + "hosts/global/common/audio.nix" # pipewire and cli controls + "hosts/global/common/bluetooth.nix" + "hosts/global/common/ddcutil.nix" # ddcutil for monitor controls + "hosts/global/common/gaming.nix" # steam, gamescope, gamemode, and related hardware + "hosts/global/common/gnome.nix" + "hosts/global/common/nvtop.nix" # GPU monitor (not available in home-manager) + "hosts/global/common/plymouth.nix" # fancy boot screen + ]) + ]; + + ## Host Specifications ## + hostSpec = { + hostName = "haze"; + username = username; + hashedPassword = user.hashedPassword; + email = user.email; + handle = user.handle; + userFullName = user.fullName; + isServer = true; + }; + + networking = { + enableIPv6 = false; + }; + + ## System-wide packages ## + programs.nix-ld.enable = true; + environment.systemPackages = with pkgs; [ + asdf-vm + ]; + + environment.sessionVariables = { + AMD_VULKAN_ICD = "RADV"; + RADV_PERFTEST = "aco"; + PROTON_USE_D9VK = 1; + }; + + # https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "25.11"; +} diff --git a/hosts/nixos/haze/hardware.nix b/hosts/nixos/haze/hardware.nix new file mode 100644 index 0000000..8a8f37c --- /dev/null +++ b/hosts/nixos/haze/hardware.nix @@ -0,0 +1,101 @@ +# 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. + +{ + pkgs, + inputs, + config, + lib, + modulesPath, + ... +}: + +{ + imports = lib.flatten [ + (modulesPath + "/installer/scan/not-detected.nix") + (map lib.custom.relativeToRoot [ + "hosts/global/common/system/pool.nix" + ]) + ]; + + ## Boot ## + boot = { + loader = { + systemd-boot = { + enable = true; + # When using plymouth, initrd can expand by a lot each time, so limit how many we keep around + configurationLimit = lib.mkDefault 10; + }; + efi.canTouchEfiVariables = true; + timeout = 3; + }; + + # Use the cachyos kernel for better performance + kernelPackages = pkgs.linuxPackages_cachyos; + + initrd = { + systemd.enable = true; + verbose = false; + availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + kernelModules = [ ]; + }; + kernelModules = [ + "kvm-amd" + "amdgpu" + ]; + extraModulePackages = [ ]; + }; + + # For less permission issues with SSHFS + programs.fuse.userAllowOther = true; + + # FIXME: Fix on first boot + # File system configurations + # fileSystems = { + # "/" = { + # device = "/dev/disk/by-uuid/d38c182c-6f05-4bf3-8a45-5532c10fd342"; + # fsType = "ext4"; + # }; + + # "/boot" = { + # device = "/dev/disk/by-uuid/5B39-A7CB"; + # fsType = "vfat"; + # options = [ + # "fmask=0077" + # "dmask=0077" + # ]; + # }; + # }; + + # FIXME: Fix on first boot + # swapDevices = [ { device = "/dev/disk/by-uuid/6586847d-eba9-4317-9077-98ae9b2812c9"; } ]; + + # Time and networking configurations + time.hardwareClockInLocalTime = true; # Fixes windows dual-boot time issues + + # 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.enp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableAllFirmware; + +} + +# STUFF ABOUT CHAOTIC NIX CACHE +# nix eval 'github:chaotic-cx/nyx/nyxpkgs-unstable#linuxPackages_cachyos.kernel.outPath' +# nix eval 'chaotic#linuxPackages_cachyos.kernel.outPath' +# nix eval '/pool/git/Nix/dot.nix#nixosConfigurations.rune.config.boot.kernelPackages.kernel.outPath' +# curl -L 'https://chaotic-nyx.cachix.org/{{HASH}}.narinfo' +# sudo nixos-rebuild switch --flake ./git/Nix/dot.nix/. --option 'extra-substituters' 'https://chaotic-nyx.cachix.org/' --option extra-trusted-public-keys "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="