From eece0b01f4628624741e46b0ff77cab8349c3e68 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Fri, 30 May 2025 10:58:20 -0500 Subject: [PATCH] more of the same --- base/base-gui/default.nix | 42 ++++- flake.nix | 149 ++++-------------- hosts/deck/configuration.nix | 61 +------ hosts/deck/home.nix | 10 -- hosts/desktop/configuration.nix | 23 --- hosts/desktop/home.nix | 10 -- hosts/nas/home.nix | 8 - .../desktop-environments/gnome/default.nix | 2 + share/amd/default.nix | 14 +- share/disko/default-hardware-config.nix | 53 ------- share/nvidia/default.nix | 6 - 11 files changed, 73 insertions(+), 305 deletions(-) delete mode 100644 share/disko/default-hardware-config.nix diff --git a/base/base-gui/default.nix b/base/base-gui/default.nix index 150b6a1..138a82c 100644 --- a/base/base-gui/default.nix +++ b/base/base-gui/default.nix @@ -1,4 +1,44 @@ -{ ... }: +{ pkgs, ... }: { imports = [ ./services.nix ]; + + # Programs configuration + programs = { + nix-ld = { + enable = true; + libraries = with pkgs; [ + alsa-lib + bash + expat + fontconfig + freetype + icu + glib + gtk3 + libgcc + libgdiplus + libGL + libpulseaudio + SDL2 + vulkan-loader + xorg.libX11 + xorg.libICE + xorg.libSM + xorg.libXcursor + xorg.libXrandr + xorg.libXi + zlib + ]; + }; + coolercontrol.enable = true; + }; + + # Hardware configs + hardware = { + # Enable graphics + graphics = { + enable = true; + enable32Bit = true; + }; + }; } \ No newline at end of file diff --git a/flake.nix b/flake.nix index 80ab98b..ccb4f8d 100755 --- a/flake.nix +++ b/flake.nix @@ -372,6 +372,13 @@ { imports = [ ./hosts/desktop/home.nix + ./share/home/defaults.nix + ./share/home/git.nix + ./share/home/gnome.nix + ./share/home/librewolf.nix + ./share/home/office.nix + ./share/home/shell.nix + ./share/home/vscode.nix desktop-steam-rom-manager.homeManagerModules.default desktop-sops-nix.homeManagerModules.sops ]; @@ -425,6 +432,11 @@ { imports = [ ./hosts/nas/home.nix + ./share/home/defaults.nix + ./share/home/git.nix + ./share/home/librewolf.nix + ./share/home/shell.nix + ./share/home/vscode.nix nas-sops-nix.homeManagerModules.sops ]; }; @@ -549,12 +561,19 @@ inherit inputs outputs; }; modules = [ + ./base/base-nogui + ./base/base-gui + ./hosts/deck/configuration.nix + ./modules/desktop-environments/gnome + + steamdeck-lanzaboote.nixosModules.lanzaboote + steamdeck-disko.nixosModules.disko ./share/disko/disko.nix + steamdeck-impermanence.nixosModules.impermanence - steamdeck-lanzaboote.nixosModules.lanzaboote - ./hosts/deck/configuration.nix ./share/impermanence + steamdeck-home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -564,6 +583,13 @@ { imports = [ ./hosts/deck/home.nix + ./share/home/defaults.nix + ./share/home/git.nix + ./share/home/gnome.nix + ./share/home/librewolf.nix + ./share/home/office.nix + ./share/home/shell.nix + ./share/home/vscode.nix steamdeck-sops-nix.homeManagerModules.sops steamdeck-steam-rom-manager.homeManagerModules.default ]; @@ -627,125 +653,6 @@ }; }; - # Improved build-all app - apps.x86_64-linux.build-all = - let - pkgs = nas-nixpkgs.legacyPackages.x86_64-linux; - in - { - type = "app"; - program = toString ( - pkgs.writeShellScript "build-all" '' - #!/usr/bin/env bash - set -euo pipefail - - # Get the list of system names directly from flake.nix - # This avoids JSON serialization issues - systems=($(grep -o '"[^"]*"[[:space:]]*=' flake.nix | grep -v '_\|#\|"\.\|\*' | sed 's/"//g' | sed 's/=//g' | xargs)) - - echo "Found systems: ''${systems[@]}" - echo "Building all compatible systems..." - - # Track success/failure - success=() - failure=() - - for system in "''${systems[@]}"; do - echo "Attempting to build $system..." - - # Detect system type without JSON evaluation - if nix eval --raw ".#nixosConfigurations.$system.pkgs.stdenv.hostPlatform.system" 2>/dev/null; then - system_type=$(nix eval --raw ".#nixosConfigurations.$system.pkgs.stdenv.hostPlatform.system" 2>/dev/null || echo "unknown") - - # Only build if we're on the same system type or can cross-compile - if [ "$system_type" = "x86_64-linux" ]; then - echo "Building $system (x86_64-linux)..." - if nix build ".#nixosConfigurations.$system.config.system.build.toplevel" --out-link "./result-$system" --no-link; then - echo "✅ Successfully built $system" - - # Copy to the binary cache - echo "Copying $system to binary cache..." - nix copy --to "https://cache.mjallen.dev?secret-key=/etc/nix/cache-priv-key.pem" ".#nixosConfigurations.$system.config.system.build.toplevel" - success+=("$system") - else - echo "❌ Failed to build $system" - failure+=("$system") - fi - elif [ "$system_type" = "aarch64-linux" ] && command -v qemu-aarch64-static >/dev/null 2>&1; then - echo "Cross-building $system (aarch64-linux)..." - if nix build ".#nixosConfigurations.$system.config.system.build.toplevel" --system aarch64-linux --out-link "./result-$system" --no-link; then - echo "✅ Successfully built $system" - nix copy --to "https://cache.mjallen.dev?secret-key=/etc/nix/cache-priv-key.pem" ".#nixosConfigurations.$system.config.system.build.toplevel" - success+=("$system") - else - echo "❌ Failed to build $system" - failure+=("$system") - fi - else - echo "⚠️ Skipping $system ($system_type) - incompatible with this host" - failure+=("$system (incompatible)") - fi - elif nix eval --raw ".#darwinConfigurations.$system.system" 2>/dev/null; then - echo "Found Darwin system $system, attempting to build packages..." - if nix build ".#darwinConfigurations.$system.system" --out-link "./result-darwin-$system" --no-link; then - echo "✅ Successfully built $system packages" - nix copy --to "https://cache.mjallen.dev?secret-key=/etc/nix/cache-priv-key.pem" ".#darwinConfigurations.$system.system" - success+=("$system (darwin)") - else - echo "❌ Failed to build $system packages" - failure+=("$system (darwin)") - fi - else - echo "⚠️ Skipping $system - could not determine system type" - failure+=("$system (unknown)") - fi - done - - # Summary - echo "" - echo "===== Build Summary =====" - echo "✅ Successfully built: ''${success[*]:-none}" - echo "❌ Failed to build: ''${failure[*]:-none}" - - # Return error code if any builds failed - if [ ''${#failure[@]} -gt 0 ]; then - exit 1 - fi - '' - ); - }; - - # You could also provide a separate script that only lists systems - apps.x86_64-linux.list-systems = - let - pkgs = nas-nixpkgs.legacyPackages.x86_64-linux; - in - { - type = "app"; - program = toString ( - pkgs.writeShellScript "list-systems" '' - #!/usr/bin/env bash - set -euo pipefail - - # Get systems from flake.nix - systems=($(grep -o '"[^"]*"[[:space:]]*=' flake.nix | grep -v '_\|#\|"\.\|\*' | sed 's/"//g' | sed 's/=//g' | xargs)) - - echo "Found systems in flake.nix:" - for system in "''${systems[@]}"; do - # Try to determine if it's a NixOS or Darwin system - if nix eval --raw ".#nixosConfigurations.$system.pkgs.stdenv.hostPlatform.system" 2>/dev/null; then - system_type=$(nix eval --raw ".#nixosConfigurations.$system.pkgs.stdenv.hostPlatform.system" 2>/dev/null) - echo " - $system (NixOS, $system_type)" - elif nix eval --raw ".#darwinConfigurations.$system.system" 2>/dev/null; then - echo " - $system (Darwin)" - else - echo " - $system (unknown type)" - fi - done - '' - ); - }; - # Expose the package set, including overlays, for convenience. darwinPackages = self.darwinConfigurations."MacBook-Pro".pkgs; diff --git a/hosts/deck/configuration.nix b/hosts/deck/configuration.nix index 9f54e2b..645e742 100755 --- a/hosts/deck/configuration.nix +++ b/hosts/deck/configuration.nix @@ -14,18 +14,6 @@ ./sops.nix ]; - services = { - # Enable CUPS to print documents. - printing.enable = true; - - xserver = { - enable = true; - desktopManager.gnome.enable = true; - }; - }; - - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users = { deck = { @@ -50,41 +38,6 @@ root.shell = pkgs.zsh; }; - programs = { - zsh.enable = true; - nix-ld = { - enable = true; - libraries = with pkgs; [ - bash - glib - gtk3 - SDL2 - libGL - openal - - xorg.libX11 - xorg.libICE - xorg.libSM - xorg.libXcursor - xorg.libXrandr - xorg.libXi - - alsa-lib - libpulseaudio - - zlib - libgdiplus - icu - - fontconfig - freetype - expat - - vulkan-loader - ]; - }; - }; - services = { btrfs = { autoScrub.enable = lib.mkDefault true; @@ -103,6 +56,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment = { + xserver.displayManager.gdm.enable = lib.mkForce false; systemPackages = with pkgs; [ fuse jq @@ -118,18 +72,5 @@ GDK_SCALE = "1"; }; }; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh.enable = true; } diff --git a/hosts/deck/home.nix b/hosts/deck/home.nix index 3591b3b..d935af4 100755 --- a/hosts/deck/home.nix +++ b/hosts/deck/home.nix @@ -8,16 +8,6 @@ let }; in { - imports = [ - ../../share/home/defaults.nix - ../../share/home/git.nix - ../../share/home/gnome.nix - ../../share/home/librewolf.nix - ../../share/home/office.nix - ../../share/home/shell.nix - ../../share/home/vscode.nix - ]; - home.username = "deck"; sops = { diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index defa34a..8ae5c13 100755 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -109,7 +109,6 @@ in ./users.nix ../default.nix ../../share/amd - # ../../modules/desktop-environments/cosmic/specialisation.nix ]; chaotic.mesa-git.enable = true; @@ -138,28 +137,6 @@ in }; }; - # Programs configuration - programs = { - nix-ld = { - enable = true; - libraries = with pkgs; [ - bash - glib - libgcc - icu - zlib - fontconfig - xorg.libX11 - xorg.libICE - xorg.libSM - xorg.libXcursor - xorg.libXrandr - xorg.libXi - ]; - }; - coolercontrol.enable = true; - }; - # Common Configuration share = { gaming.enable = true; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 3a5fbbd..f6851a9 100755 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -8,16 +8,6 @@ let }; in { - imports = [ - ../../share/home/defaults.nix - ../../share/home/git.nix - ../../share/home/gnome.nix - ../../share/home/librewolf.nix - ../../share/home/office.nix - ../../share/home/shell.nix - ../../share/home/vscode.nix - ]; - home.username = "matt"; sops = { diff --git a/hosts/nas/home.nix b/hosts/nas/home.nix index c6f0d1e..0a26e7e 100755 --- a/hosts/nas/home.nix +++ b/hosts/nas/home.nix @@ -7,14 +7,6 @@ let }; in { - imports = [ - ../../share/home/defaults.nix - ../../share/home/git.nix - ../../share/home/librewolf.nix - ../../share/home/shell.nix - ../../share/home/vscode.nix - ]; - home.username = "admin"; sops = { diff --git a/modules/desktop-environments/gnome/default.nix b/modules/desktop-environments/gnome/default.nix index d9f0b63..1cad595 100644 --- a/modules/desktop-environments/gnome/default.nix +++ b/modules/desktop-environments/gnome/default.nix @@ -13,6 +13,8 @@ gnome.gnome-remote-desktop.enable = true; }; + + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; programs = { kdeconnect = { diff --git a/share/amd/default.nix b/share/amd/default.nix index d95edb0..f7bc3f2 100755 --- a/share/amd/default.nix +++ b/share/amd/default.nix @@ -33,20 +33,8 @@ in }; }; - # Hardware configs - hardware = { - # Enable graphics - graphics = { - enable = true; - enable32Bit = true; - # extraPackages = [ pkgsVersion.mesa ]; - # extraPackages32 = [ pkgsVersion.pkgsi686Linux.mesa ]; - }; - }; - # Configure polkit - security.polkit = { - # enable = cfg.corectrl.enablePolkit; + security.polkit = lib.mkIf cfg.corectrl.enablePolkit { extraConfig = '' polkit.addRule(function(action, subject) { if ((action.id == "org.corectrl.helper.init" || diff --git a/share/disko/default-hardware-config.nix b/share/disko/default-hardware-config.nix deleted file mode 100644 index 1a4e5f1..0000000 --- a/share/disko/default-hardware-config.nix +++ /dev/null @@ -1,53 +0,0 @@ -# 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") - ]; - - fileSystems."/" = - { device = "none"; - fsType = "tmpfs"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-label/ESP"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - fileSystems."/nix" = - { device = "/dev/disk/by-label/btrfs-root"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" "noatime" ]; - }; - - fileSystems."/etc" = - { device = "/dev/disk/by-label/btrfs-root"; - fsType = "btrfs"; - options = [ "subvol=etc" "compress=zstd" "noatime" ]; - }; - - fileSystems."/var/log" = - { device = "/dev/disk/by-label/btrfs-root"; - fsType = "btrfs"; - options = [ "subvol=log" "compress=zstd" "noatime" ]; - }; - - fileSystems."/root" = - { device = "/dev/disk/by-label/btrfs-root"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "noatime" ]; - }; - - fileSystems."/home" = - { device = "/dev/disk/by-label/btrfs-root"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" ]; - }; - - swapDevices = [ ]; -} diff --git a/share/nvidia/default.nix b/share/nvidia/default.nix index 4b18c5d..7a49303 100755 --- a/share/nvidia/default.nix +++ b/share/nvidia/default.nix @@ -44,12 +44,6 @@ in # accessible via `nvidia-settings`. nvidiaSettings = cfg.nvidiaSettings; }; - - # Enable graphics - graphics = { - enable = true; - enable32Bit = true; - }; }; # Services configs