From 079b0858d9bfaa97ae7e492eda970056431308d8 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Mon, 3 Mar 2025 17:08:24 -0600 Subject: [PATCH] hyprland and myPkg/overlay migrations --- nixos/home/modules/de/hyprland.nix | 13 ++++- nixos/hosts/telchar/default.nix | 53 +++++++------------ nixos/lib/default.nix | 1 + nixos/modules/nixos/de/hyprland.nix | 7 +++ nixos/overlays/default.nix | 25 +++++---- .../charm-mods/default.nix | 11 ++-- nixos/profiles/hw-framework-16-7840hs.nix | 17 ++++++ nixos/profiles/role-dev.nix | 3 +- 8 files changed, 75 insertions(+), 55 deletions(-) rename nixos/{overlays => packages}/charm-mods/default.nix (81%) diff --git a/nixos/home/modules/de/hyprland.nix b/nixos/home/modules/de/hyprland.nix index 89e6295..ea07543 100644 --- a/nixos/home/modules/de/hyprland.nix +++ b/nixos/home/modules/de/hyprland.nix @@ -12,9 +12,10 @@ in { imports = [inputs.ags.homeManagerModules.default]; config = mkIf cfg.enable { + # Theme settings gtk = { enable = true; - + # Some apps just need the good ol' ini files. gtk3.extraConfig = { gtk-application-prefer-dark-theme = 1; gtk-theme-name = "Andromeda-dark"; @@ -52,6 +53,16 @@ in { gtk-xft-rgba = "rgb"; }; }; + # Wayland and apps pull from dconf since we're using the gtk portal. + dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = "prefer-dark"; + cursor-size = 24; + cursor-theme = "Bibata-Modern-Ice"; + gtk-theme = "Flat-Remix-GTK-Blue-Dark"; + icon-theme = "Flat-Remix-Blue-Dark"; + }; + }; programs.ags = { enable = true; diff --git a/nixos/hosts/telchar/default.nix b/nixos/hosts/telchar/default.nix index 84c4766..90a4aed 100644 --- a/nixos/hosts/telchar/default.nix +++ b/nixos/hosts/telchar/default.nix @@ -1,11 +1,4 @@ -{ - config, - pkgs, - myPkgs, - inputs, - ... -}: let - hypr-pkgs = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +{pkgs, ...}: let in { imports = []; swapDevices = []; @@ -13,41 +6,22 @@ in { # System packages environment.systemPackages = with pkgs; [ - uv + # myPkgs.modrinth-app-unwrapped + dconf-editor fastfetch gtk3 - dconf-editor - # myPkgs.modrinth-app-unwrapped - zulu # Java OpenJDK nodejs_22 - vesktop + pavucontrol # Pulseaudio volume control + uv # python package manager + vesktop # Discord custom client + zulu # Java OpenJDK ]; - hardware.graphics = { - package = hypr-pkgs.mesa.drivers; - }; - environment.sessionVariables = { # Wayland and Chromium/Electron apps. NIXOS_OZONE_WL = "1"; }; - # sops - # sops.secrets = { - # "syncthing/publicCert" = { - # sopsFile = ./secrets.sops.yaml; - # owner = "jahanson"; - # mode = "400"; - # restartUnits = ["syncthing.service"]; - # }; - # "syncthing/privateKey" = { - # sopsFile = ./secrets.sops.yaml; - # owner = "jahanson"; - # mode = "400"; - # restartUnits = ["syncthing.service"]; - # }; - #}; - services = { # Tailscale tailscale = { @@ -58,8 +32,19 @@ in { pipewire = { enable = true; alsa.enable = true; - jack.enable = true; pulse.enable = true; + extraConfig.pipewire = { + "10-clock-rate" = { + "context.properties" = { + "default.clock.rate" = 48000; + }; + }; + "10-clock-quantum" = { + "context.properties" = { + "default.clock.quantum" = 1024; + }; + }; + }; }; blueman.enable = true; }; diff --git a/nixos/lib/default.nix b/nixos/lib/default.nix index 2ca0c84..8ebfa27 100644 --- a/nixos/lib/default.nix +++ b/nixos/lib/default.nix @@ -12,6 +12,7 @@ with lib; rec { # Create custom package set mkMyPkgs = pkgs: { borgmatic = pkgs.callPackage ../../nixos/packages/borgmatic {}; + mods = pkgs.callPackage ../../nixos/packages/charm-mods {}; # modrinth-app-unwrapped = pkgs.callPackage ../../nixos/packages/modrinth {}; }; diff --git a/nixos/modules/nixos/de/hyprland.nix b/nixos/modules/nixos/de/hyprland.nix index 099ce2f..5c1e433 100644 --- a/nixos/modules/nixos/de/hyprland.nix +++ b/nixos/modules/nixos/de/hyprland.nix @@ -6,6 +6,7 @@ ... }: let cfg = config.mySystem.de.hyprland; + hypr-pkgs = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; in { options = { mySystem.de.hyprland = { @@ -17,6 +18,12 @@ in { }; }; config = lib.mkIf cfg.enable { + # We need all hyprland packages to follow the same MESA version + hardware = { + graphics = { + package = hypr-pkgs.mesa.drivers; + }; + }; # Hyprland nixpkgs system packages environment.systemPackages = with pkgs; [ # Hyprland diff --git a/nixos/overlays/default.nix b/nixos/overlays/default.nix index dd21ba8..3d58402 100644 --- a/nixos/overlays/default.nix +++ b/nixos/overlays/default.nix @@ -1,17 +1,15 @@ -{ inputs, ... }: -let +{inputs, ...}: let # smartmontoolsOverlay = import ./smartmontools { }; # vivaldiOverlay = self: super: { vivaldi = super.callPackage ./vivaldi { }; }; - coderOverlay = self: super: { coder = super.callPackage ./coder { }; }; - modsOverlay = self: super: { mods = super.callPackage ./charm-mods { }; }; - termiusOverlay = self: super: { termius = super.callPackage ./termius { }; }; -in -{ + coderOverlay = self: super: {coder = super.callPackage ./coder {};}; + # modsOverlay = self: super: { mods = super.callPackage ./charm-mods { }; }; + termiusOverlay = self: super: {termius = super.callPackage ./termius {};}; +in { # smartmontools = smartmontoolsOverlay; # vivaldi = vivaldiOverlay; coder = coderOverlay; comm-packages = inputs.nix-vscode-extensions.overlays.default; - mods = modsOverlay; + # mods = modsOverlay; nix-minecraft = inputs.nix-minecraft.overlay; nur = inputs.nur.overlays.default; termius = termiusOverlay; @@ -27,17 +25,18 @@ in // { # Add talosctl to the unstable set talosctl = final.unstable.callPackage ./talosctl { - inherit (final.unstable) + inherit + (final.unstable) lib buildGoModule fetchFromGitHub installShellFiles ; }; - xpipe = final.unstable.callPackage ./xpipe/ptb.nix { }; - prowlarr = final.unstable.callPackage ./arr/prowlarr.nix { }; - radarr = final.unstable.callPackage ./arr/radarr.nix { }; - sonarr = final.unstable.callPackage ./arr/sonarr.nix { }; + xpipe = final.unstable.callPackage ./xpipe/ptb.nix {}; + prowlarr = final.unstable.callPackage ./arr/prowlarr.nix {}; + radarr = final.unstable.callPackage ./arr/radarr.nix {}; + sonarr = final.unstable.callPackage ./arr/sonarr.nix {}; }; }; } diff --git a/nixos/overlays/charm-mods/default.nix b/nixos/packages/charm-mods/default.nix similarity index 81% rename from nixos/overlays/charm-mods/default.nix rename to nixos/packages/charm-mods/default.nix index 41d131f..6782d41 100644 --- a/nixos/overlays/charm-mods/default.nix +++ b/nixos/packages/charm-mods/default.nix @@ -7,20 +7,19 @@ testers, mods, }: - buildGoModule rec { pname = "mods"; - version = "1.6.0"; - commitHash = "2a7f9d4dc11b6c828bf35a0b3d0be709f3ed79b9"; + version = "1.7.0"; + commitHash = "bf8337f9f4c586aaa267f8019ac2d0daa3b30129"; src = fetchFromGitHub { owner = "charmbracelet"; repo = "mods"; rev = commitHash; - hash = "sha256-23gtb8BOx/0c643/paRt7VFHEyMyF4Q4a5b5+a4+kNU="; + hash = "sha256-EoDia+7ObtpnTDjJMzOk9djyCrW0m9pIToNHEDZ8Ch8="; }; - vendorHash = "sha256-RV/Nr60BpCLcUL2Yy1Dd2ScwoI0BhGhTb/igCEcJPjI="; + vendorHash = "sha256-dnKvT3VcvidfDcgJ9FerjtReIOwvRZtJZiBwNx2BEQ8="; nativeBuildInputs = [ installShellFiles @@ -33,7 +32,7 @@ buildGoModule rec { ]; # These tests require internet access. - checkFlags = [ "-skip=^TestLoad/http_url$|^TestLoad/https_url$" ]; + checkFlags = ["-skip=^TestLoad/http_url$|^TestLoad/https_url$"]; passthru = { updateScript = gitUpdater { diff --git a/nixos/profiles/hw-framework-16-7840hs.nix b/nixos/profiles/hw-framework-16-7840hs.nix index d274573..3311d8d 100644 --- a/nixos/profiles/hw-framework-16-7840hs.nix +++ b/nixos/profiles/hw-framework-16-7840hs.nix @@ -1,6 +1,7 @@ { lib, config, + pkgs, ... }: { imports = []; @@ -12,6 +13,22 @@ powerOnBoot = true; }; }; + # Force SOF for AMD controller while keeping HDA for HDMI + boot.kernelParams = [ + "snd-intel-dspcfg.dsp_driver=3" # SOF for AMD Zen2+ audio + ]; + + # Essential firmware packages + hardware.firmware = with pkgs; [ + sof-firmware + alsa-firmware + ]; + + # SOF-specific configuration + boot.extraModprobeConfig = '' + options snd-hda-intel model=auto position_fix=1 + options snd-hda-intel power_save=1 + ''; boot = { # for managing/mounting nfs diff --git a/nixos/profiles/role-dev.nix b/nixos/profiles/role-dev.nix index 535890a..9a98c0f 100644 --- a/nixos/profiles/role-dev.nix +++ b/nixos/profiles/role-dev.nix @@ -1,5 +1,6 @@ { pkgs, + myPkgs, inputs, ... }: @@ -57,8 +58,8 @@ inputs.talhelper.packages.${pkgs.system}.default # charmbracelet tools + myPkgs.mods gum - mods skate soft-serve unstable.glow