From 257cee4560b2c6d9b954a359de05cd12b50b709c Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 16:01:16 -0500 Subject: [PATCH 01/11] chore: add starship --- .config/starship.toml | 60 ++++++++++++++++++++++++++++++++++++++ home-manager/default.nix | 45 ++++++++++++++++++---------- home-manager/p10k/p10k.zsh | 3 ++ 3 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 .config/starship.toml diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 00000000..77b3be9a --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,60 @@ +"$schema" = 'https://starship.rs/config-schema.json' + +format = """ +[░▒▓](#a3aed2)\ +[  ](bg:#a3aed2 fg:#090c0c)\ +[](bg:#769ff0 fg:#a3aed2)\ +$directory\ +[](fg:#769ff0 bg:#394260)\ +$git_branch\ +$git_status\ +[](fg:#394260 bg:#212736)\ +$fill\ +$nodejs\ +$rust\ +$python\ +$pulumi\ +$golang\ +$nix_shell\ +\n$character""" + +[directory] +style = "fg:#e3e5e5 bg:#769ff0" +truncate_to_repo = true +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +[fill] +symbol = ' ' + +[pulumi] +format = '[$symbol$stack]($style) ' + +[git_branch] +symbol = "" +style = "bg:#394260" +format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)' + +[git_status] +style = "bg:#394260" +format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)' + +[nodejs] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[rust] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[golang] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[nix_shell] +symbol = '❄️' +format = '[$symbol $state]($style) ' diff --git a/home-manager/default.nix b/home-manager/default.nix index f8843ab3..619f8ee2 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -16,6 +16,7 @@ xdg.configFile."ghostty/config".source = ./../.config/ghostty/config; xdg.configFile."direnv/direnv.toml".source = ./../.config/direnv/direnv.toml; xdg.configFile."zed/settings.json.backup".source = ./../.config/zed/settings.json; + xdg.configFile."starship.toml".source = ./../.config/starship.toml; home = { stateVersion = "24.05"; @@ -29,6 +30,7 @@ nixfmt nil tree + starship ]; }; @@ -53,11 +55,6 @@ src = ./p10k; file = "p10k.zsh"; } - { - name = "zsh-powerlevel10k"; - src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/"; - file = "powerlevel10k.zsh-theme"; - } ]; shellAliases = { gauth = "gcloud auth login --update-adc --brief"; @@ -73,18 +70,34 @@ sudo launchctl kickstart -k system/systems.determinate.nix-installer.nix-hook ''; }; - initContent = lib.mkBefore '' - # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. - # Initialization code that may require console input (password prompts, [y/n] - # confirmations, etc.) must go above this block; everything else may go below. - if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then - source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" - fi + initContent = lib.mkMerge [ + (lib.mkBefore '' + # Enable Powerlevel10k instant prompt (skipped when using starship). + # Initialization code that may require console input (password prompts, [y/n] + # confirmations, etc.) must go above this block; everything else may go below. + if [[ ''${PROMPT_THEME:-p10k} == p10k ]]; then + if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then + source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" + fi + fi - export NVM_DIR="$HOME/.nvm" - [ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm - [ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion - ''; + export NVM_DIR="$HOME/.nvm" + [ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm + [ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion + '') + '' + # Load p10k theme only when selected (keeps starship shell clean) + if [[ ''${PROMPT_THEME:-p10k} == p10k ]]; then + source "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme" + else + eval "$(starship init zsh)" + fi + + # Helper functions to switch prompts in the current shell session + prompt-starship() { PROMPT_THEME=starship exec zsh; } + prompt-p10k() { PROMPT_THEME=p10k exec zsh; } + '' + ]; oh-my-zsh = { enable = true; diff --git a/home-manager/p10k/p10k.zsh b/home-manager/p10k/p10k.zsh index e288e9c5..d8abb299 100644 --- a/home-manager/p10k/p10k.zsh +++ b/home-manager/p10k/p10k.zsh @@ -1,3 +1,6 @@ +# Skip p10k config when using a different prompt theme +[[ ${PROMPT_THEME:-p10k} == p10k ]] || return + # Generated by Powerlevel10k configuration wizard on 2025-02-15 at 10:24 CST. # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 37983. # Wizard options: nerdfont-v3 + powerline, small icons, unicode, lean, 2 lines, From c00c4adaea0c20f062cb41362b0d9e2ad3b99d83 Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 16:02:30 -0500 Subject: [PATCH 02/11] fix: prefer native macOS `ls` over gnu coreutils --- home-manager/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home-manager/default.nix b/home-manager/default.nix index 619f8ee2..43084b76 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -58,7 +58,8 @@ ]; shellAliases = { gauth = "gcloud auth login --update-adc --brief"; - ll = "ls -l"; + ls = "/bin/ls -G"; + ll = "ls -lh"; t = "gittower"; switch = "sudo darwin-rebuild switch --flake ."; update = "nix flake update"; From a590ba7fb198664dff425953ea8a315addf72c3b Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 16:13:32 -0500 Subject: [PATCH 03/11] feat: add wallpaper to dunston --- darwin/hosts/dunston.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwin/hosts/dunston.nix b/darwin/hosts/dunston.nix index 17cd7765..11834a10 100644 --- a/darwin/hosts/dunston.nix +++ b/darwin/hosts/dunston.nix @@ -8,5 +8,7 @@ video.enable = true; }; + wallpaper = ../../wallpapers/deeptwilight.png; + fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; } From f74418dd28c529a99b1a4af84bd4720e5103b68f Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 16:22:06 -0500 Subject: [PATCH 04/11] chore: improve wallpaper config --- darwin/hosts/dunston.nix | 5 ++++- darwin/hosts/mfourmax.nix | 5 ++++- darwin/modules/defaults.nix | 4 ++-- darwin/modules/homebrew.nix | 1 + darwin/modules/wallpaper.nix | 24 +++++++++++++++++------- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/darwin/hosts/dunston.nix b/darwin/hosts/dunston.nix index 11834a10..3af7d82f 100644 --- a/darwin/hosts/dunston.nix +++ b/darwin/hosts/dunston.nix @@ -8,7 +8,10 @@ video.enable = true; }; - wallpaper = ../../wallpapers/deeptwilight.png; + wallpaper = { + enable = true; + image = ../../wallpapers/deeptwilight.png; + }; fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; } diff --git a/darwin/hosts/mfourmax.nix b/darwin/hosts/mfourmax.nix index d7a3f1f3..6e1f84e4 100644 --- a/darwin/hosts/mfourmax.nix +++ b/darwin/hosts/mfourmax.nix @@ -3,7 +3,10 @@ { fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; - wallpaper = ../../wallpapers/deeptwilight.png; + wallpaper = { + enable = true; + image = ../../wallpapers/deeptwilight.png; + }; dock.extraApps = [ "/Applications/Figma.app" diff --git a/darwin/modules/defaults.nix b/darwin/modules/defaults.nix index b7fecfa6..8570580b 100644 --- a/darwin/modules/defaults.nix +++ b/darwin/modules/defaults.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, ... }: { system.defaults = { @@ -37,7 +37,7 @@ # Current Folder FXDefaultSearchScope = "SCcf"; NewWindowTarget = "Other"; - NewWindowTargetPath = "file://${builtins.getEnv "HOME"}"; + NewWindowTargetPath = "file://${config.users.users.${config.system.primaryUser}.home}"; }; dock = { diff --git a/darwin/modules/homebrew.nix b/darwin/modules/homebrew.nix index 6151843c..e9140448 100644 --- a/darwin/modules/homebrew.nix +++ b/darwin/modules/homebrew.nix @@ -29,6 +29,7 @@ "crystalfetch" "codex" "cursor" + "desktoppr" "discord" "docker-desktop" "dropbox" diff --git a/darwin/modules/wallpaper.nix b/darwin/modules/wallpaper.nix index abfb5e29..d681e6ce 100644 --- a/darwin/modules/wallpaper.nix +++ b/darwin/modules/wallpaper.nix @@ -8,17 +8,27 @@ let cfg = config.wallpaper; in { - options.wallpaper = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = "Path to wallpaper image file"; + options.wallpaper = { + enable = lib.mkEnableOption "Apply a wallpaper for the primary user"; + + image = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = "Path to wallpaper image file"; + }; }; - config = lib.mkIf (cfg != null) { - homebrew.casks = [ "desktoppr" ]; + config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = cfg.image != null; + message = "wallpaper.image must be set when wallpaper.enable is true."; + } + ]; system.activationScripts.postActivation.text = '' - sudo -u ${config.system.primaryUser} /usr/local/bin/desktoppr "${cfg}" + # desktoppr cask installs the CLI at /usr/local/bin/desktoppr + sudo -u ${config.system.primaryUser} /usr/local/bin/desktoppr "${cfg.image}" ''; }; } From 6b1c9e23741cb4bd52fbbcb1cf31eda330ec54c1 Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 16:29:59 -0500 Subject: [PATCH 05/11] refactor: isolate determinate nix trusted-users workaround --- darwin/darwin.nix | 1 + darwin/modules/activation.nix | 7 ------- darwin/modules/base.nix | 1 + darwin/modules/determinate-nix.nix | 33 ++++++++++++++++++++++++++++++ flake.nix | 1 - 5 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 darwin/modules/determinate-nix.nix diff --git a/darwin/darwin.nix b/darwin/darwin.nix index 1e1acbe9..348c2d3d 100644 --- a/darwin/darwin.nix +++ b/darwin/darwin.nix @@ -9,6 +9,7 @@ ./modules/defaults.nix ./modules/dock.nix ./modules/activation.nix + ./modules/determinate-nix.nix ./modules/profiles.nix ./modules/wallpaper.nix ./audio.nix diff --git a/darwin/modules/activation.nix b/darwin/modules/activation.nix index 7320ab45..155d41f0 100644 --- a/darwin/modules/activation.nix +++ b/darwin/modules/activation.nix @@ -5,13 +5,6 @@ # Show Library folder chflags nohidden "/Users/${config.system.primaryUser}/Library" - # Configure trusted-users for Determinate Nix - if [ -f /etc/nix/nix.custom.conf ]; then - if ! grep -q "trusted-users.*${config.system.primaryUser}" /etc/nix/nix.custom.conf; then - echo "trusted-users = root ${config.system.primaryUser}" >> /etc/nix/nix.custom.conf - fi - fi - # TODO: Disable until I can determine why this inverts natural scrolling option # Following line should allow us to avoid a logout/login cycle to see changes # /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u diff --git a/darwin/modules/base.nix b/darwin/modules/base.nix index 6de97fc9..9945cc1e 100644 --- a/darwin/modules/base.nix +++ b/darwin/modules/base.nix @@ -8,6 +8,7 @@ # Since we are using determinate nix distribution nix.enable = false; + determinateNix.enable = true; programs = { gnupg.agent.enable = true; diff --git a/darwin/modules/determinate-nix.nix b/darwin/modules/determinate-nix.nix new file mode 100644 index 00000000..b017bdb6 --- /dev/null +++ b/darwin/modules/determinate-nix.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + ... +}: + +let + cfg = config.determinateNix; + trustedUsers = lib.concatStringsSep " " cfg.trustedUsers; +in +{ + options.determinateNix = { + enable = lib.mkEnableOption "Determinate Nix compatibility tweaks"; + + trustedUsers = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ config.system.primaryUser ]; + description = "Users that should be written to /etc/nix/nix.custom.conf."; + }; + }; + + config = lib.mkIf cfg.enable { + system.activationScripts.determinateNix.text = '' + if [ -f /etc/nix/nix.custom.conf ]; then + tmp="$(mktemp)" + grep -v '^trusted-users *=.*$' /etc/nix/nix.custom.conf > "$tmp" || true + echo "trusted-users = root ${trustedUsers}" >> "$tmp" + cat "$tmp" > /etc/nix/nix.custom.conf + rm -f "$tmp" + fi + ''; + }; +} diff --git a/flake.nix b/flake.nix index dd259bb6..14fd7af4 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,6 @@ users.${user} = import ./home-manager; }; users.users.${user}.home = "/Users/${user}"; - nix.settings.trusted-users = [ user ]; } ] ++ configs; From 6ff1856c052d2e54b2772848787c87b6ed8159ec Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 17:39:57 -0500 Subject: [PATCH 06/11] chore: manage Zed settings via out-of-store symlink --- .config/zed/settings.json | 42 ++++++++++++++++++++++----------------- home-manager/default.nix | 3 ++- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.config/zed/settings.json b/.config/zed/settings.json index d462e799..7e8e030c 100644 --- a/.config/zed/settings.json +++ b/.config/zed/settings.json @@ -1,33 +1,39 @@ -// Zed settings -// -// For information on how to configure Zed, see the Zed -// documentation: https://zed.dev/docs/configuring-zed -// -// To see all of Zed's default settings without changing your -// custom settings, run `zed: open default settings` from the -// command palette (cmd-shift-p / ctrl-shift-p) { - "icon_theme": "VSCode Icons (Dark)", -{ - "assistant": { + "context_servers": { + "mcp-server-github": { + "source": "extension", + "enabled": true, + "settings": {} + } + }, + "icon_theme": "VSCode Icons for Zed (Dark Official Icons)", + "agent": { + "inline_assistant_model": { + "provider": "zed.dev", + "model": "claude-sonnet-4-latest" + }, "default_model": { - "provider": "google", - "model": "gemini-2.5-pro-exp-03-25" + "provider": "zed.dev", + "model": "claude-sonnet-4-thinking" }, "always_allow_tool_actions": true, - "default_profile": "write", - "version": "2" - } -} + "default_profile": "write" + }, "features": { "edit_prediction_provider": "zed" }, "ui_font_size": 16, - "buffer_font_size": 17.0, + "buffer_font_size": 12.0, "buffer_font_family": "MesloLGS Nerd Font Mono", "theme": { "mode": "system", "light": "One Light", "dark": "Tokyo Night Storm" + }, + "agent_servers": { + "OpenCode": { + "command": "opencode", + "args": ["acp"] + } } } diff --git a/home-manager/default.nix b/home-manager/default.nix index 43084b76..cb9b3e46 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -15,7 +15,8 @@ xdg.configFile."ghostty/config".source = ./../.config/ghostty/config; xdg.configFile."direnv/direnv.toml".source = ./../.config/direnv/direnv.toml; - xdg.configFile."zed/settings.json.backup".source = ./../.config/zed/settings.json; + xdg.configFile."zed/settings.json".source = + config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/src/dotfiles/.config/zed/settings.json"; xdg.configFile."starship.toml".source = ./../.config/starship.toml; home = { From 276d166e27f7e9467e3ab280fb5597247ccc4a9c Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 17:43:27 -0500 Subject: [PATCH 07/11] chore: remove nil from hm packages --- home-manager/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/home-manager/default.nix b/home-manager/default.nix index cb9b3e46..9b83c057 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -29,7 +29,6 @@ cloudlens cmatrix nixfmt - nil tree starship ]; From 9b37e41e400a42915f7141ba11ea9fc5f5a31398 Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 17:49:16 -0500 Subject: [PATCH 08/11] chore: add treefmt and deadnix to flake checks --- AGENTS.md | 14 ++++++++------ README.md | 11 +++++++++++ flake.nix | 40 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 966755ff..6da940c9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ - **Check formatting (CI)**: `nix develop -c treefmt --ci` - **Check for unused Nix code**: `nix run nixpkgs#deadnix -- --fail` - **Show flake outputs**: `nix flake show` -- **Flake check**: `nix flake check --keep-going --print-build-logs` +- **Primary validation command**: `nix flake check --keep-going --print-build-logs` - **Evaluate host config**: `nix eval --raw .#darwinConfigurations..config.system.build.toplevel.drvPath` - **Build host config**: `nix build --keep-going --print-build-logs .#darwinConfigurations..config.system.build.toplevel` - **Apply changes**: `sudo darwin-rebuild switch --flake .#` (hosts: higgins, benson, spaceblack, dunston, mfourmax) @@ -22,11 +22,13 @@ ## Testing Workflow Before applying changes: -1. Check formatting: `treefmt --ci` -2. Check for dead code: `nix run nixpkgs#deadnix -- --fail` -3. Run flake check: `nix flake check --keep-going --print-build-logs` -4. Build specific host: `nix build .#darwinConfigurations..config.system.build.toplevel` -5. Apply if successful: `sudo darwin-rebuild switch --flake .#` +1. Run the primary validation suite: `nix flake check --keep-going --print-build-logs` +2. Build the specific host when host changes are involved: `nix build .#darwinConfigurations..config.system.build.toplevel` +3. Apply if successful: `sudo darwin-rebuild switch --flake .#` + +Use targeted checks when you want faster feedback on a specific issue: +- `treefmt --ci` +- `nix run nixpkgs#deadnix -- --fail` ## Code Style - **Language**: Nix using RFC-style formatting (nixfmt) diff --git a/README.md b/README.md index 907015a3..7082dc52 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,15 @@ Install Nix using [Determinate Systems Installer](https://github.com/Determinate `sudo darwin-rebuild switch --flake .#` +## Validate + +Run this first for the standard repo checks: + +`nix flake check --keep-going --print-build-logs` + +Optional targeted checks: + +- `treefmt --ci` +- `nix run nixpkgs#deadnix -- --fail` +- `nix build .#darwinConfigurations..config.system.build.toplevel` diff --git a/flake.nix b/flake.nix index 14fd7af4..bf77d82a 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,13 @@ ... }@inputs: let + systems = [ + "aarch64-darwin" + "x86_64-linux" + ]; + + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); + darwinSystem = hostname: { @@ -65,6 +72,21 @@ git config core.hooksPath hooks ''; }; + + mkCheck = + pkgs: name: nativeBuildInputs: command: + pkgs.runCommand name + { + inherit nativeBuildInputs; + src = ./.; + } + '' + cp -r "$src" repo + chmod -R +w repo + cd repo + ${command} + touch "$out" + ''; in { darwinConfigurations = builtins.mapAttrs darwinSystem { @@ -95,11 +117,25 @@ }; }; - formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt; + formatter = forAllSystems (pkgs: pkgs.nixfmt); devShells.aarch64-darwin.default = devShellFor "aarch64-darwin"; # For CI lint on linux runners devShells.x86_64-linux.default = devShellFor "x86_64-linux"; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; + checks = forAllSystems (pkgs: { + treefmt = + mkCheck pkgs "treefmt-check" + [ + pkgs.treefmt + pkgs.nixfmt + ] + '' + treefmt --ci + ''; + + deadnix = mkCheck pkgs "deadnix-check" [ pkgs.deadnix ] '' + deadnix --fail . + ''; + }); }; } From f6e5613663114cccd49a0589c5bbd0ea98a141b1 Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 18:04:56 -0500 Subject: [PATCH 09/11] refactor: DRY shared host profiles and nerd fonts --- darwin/darwin.nix | 1 + darwin/hosts/benson.nix | 10 ++++------ darwin/hosts/dunston.nix | 14 +++++--------- darwin/hosts/higgins.nix | 10 ++++------ darwin/hosts/mfourmax.nix | 4 +--- darwin/hosts/shared/gaming.nix | 5 +++++ darwin/hosts/shared/media.nix | 9 +++++++++ darwin/hosts/spaceblack.nix | 6 ++---- darwin/modules/homebrew.nix | 3 --- darwin/modules/nerd-fonts.nix | 10 ++++++++++ 10 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 darwin/hosts/shared/gaming.nix create mode 100644 darwin/hosts/shared/media.nix create mode 100644 darwin/modules/nerd-fonts.nix diff --git a/darwin/darwin.nix b/darwin/darwin.nix index 348c2d3d..b0e6da35 100644 --- a/darwin/darwin.nix +++ b/darwin/darwin.nix @@ -5,6 +5,7 @@ ./modules/base.nix ./modules/packages.nix ./modules/fonts.nix + ./modules/nerd-fonts.nix ./modules/homebrew.nix ./modules/defaults.nix ./modules/dock.nix diff --git a/darwin/hosts/benson.nix b/darwin/hosts/benson.nix index 7a849392..6d20394a 100644 --- a/darwin/hosts/benson.nix +++ b/darwin/hosts/benson.nix @@ -1,10 +1,8 @@ { ... }: { - profiles = { - audio.enable = true; - gaming.enable = true; - photography.enable = true; - video.enable = true; - }; + imports = [ + ./shared/media.nix + ./shared/gaming.nix + ]; } diff --git a/darwin/hosts/dunston.nix b/darwin/hosts/dunston.nix index 3af7d82f..23b78078 100644 --- a/darwin/hosts/dunston.nix +++ b/darwin/hosts/dunston.nix @@ -1,17 +1,13 @@ -{ pkgs, lib, ... }: +{ ... }: { - profiles = { - audio.enable = true; - gaming.enable = true; - photography.enable = true; - video.enable = true; - }; + imports = [ + ./shared/media.nix + ./shared/gaming.nix + ]; wallpaper = { enable = true; image = ../../wallpapers/deeptwilight.png; }; - - fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; } diff --git a/darwin/hosts/higgins.nix b/darwin/hosts/higgins.nix index 7a849392..6d20394a 100644 --- a/darwin/hosts/higgins.nix +++ b/darwin/hosts/higgins.nix @@ -1,10 +1,8 @@ { ... }: { - profiles = { - audio.enable = true; - gaming.enable = true; - photography.enable = true; - video.enable = true; - }; + imports = [ + ./shared/media.nix + ./shared/gaming.nix + ]; } diff --git a/darwin/hosts/mfourmax.nix b/darwin/hosts/mfourmax.nix index 6e1f84e4..4700702d 100644 --- a/darwin/hosts/mfourmax.nix +++ b/darwin/hosts/mfourmax.nix @@ -1,8 +1,6 @@ -{ pkgs, lib, ... }: +{ ... }: { - fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; - wallpaper = { enable = true; image = ../../wallpapers/deeptwilight.png; diff --git a/darwin/hosts/shared/gaming.nix b/darwin/hosts/shared/gaming.nix new file mode 100644 index 00000000..f59988a1 --- /dev/null +++ b/darwin/hosts/shared/gaming.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + profiles.gaming.enable = true; +} diff --git a/darwin/hosts/shared/media.nix b/darwin/hosts/shared/media.nix new file mode 100644 index 00000000..d5454bad --- /dev/null +++ b/darwin/hosts/shared/media.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + profiles = { + audio.enable = true; + photography.enable = true; + video.enable = true; + }; +} diff --git a/darwin/hosts/spaceblack.nix b/darwin/hosts/spaceblack.nix index ab65e6f0..5bd3e36b 100644 --- a/darwin/hosts/spaceblack.nix +++ b/darwin/hosts/spaceblack.nix @@ -1,5 +1,3 @@ -{ pkgs, lib, ... }: +{ ... }: -{ - fonts.packages = lib.mkAfter [ pkgs.nerd-fonts.fira-code ]; -} +{ } diff --git a/darwin/modules/homebrew.nix b/darwin/modules/homebrew.nix index e9140448..6a67f5bc 100644 --- a/darwin/modules/homebrew.nix +++ b/darwin/modules/homebrew.nix @@ -36,9 +36,6 @@ "expo-orbit" "figma" "firefox" - "font-bitstream-vera-sans-mono-nerd-font" - "font-hack-nerd-font" - "font-meslo-lg-nerd-font" "ghostty" "gitkraken" "gitkraken-cli" diff --git a/darwin/modules/nerd-fonts.nix b/darwin/modules/nerd-fonts.nix new file mode 100644 index 00000000..0e1a0f64 --- /dev/null +++ b/darwin/modules/nerd-fonts.nix @@ -0,0 +1,10 @@ +{ ... }: + +{ + homebrew.casks = [ + "font-bitstream-vera-sans-mono-nerd-font" + "font-fira-code-nerd-font" + "font-hack-nerd-font" + "font-meslo-lg-nerd-font" + ]; +} From 3eac957e3a4c246be802b3cee3a60f208d1d81fb Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 18:57:58 -0500 Subject: [PATCH 10/11] feedback --- darwin/modules/determinate-nix.nix | 5 ++--- flake.nix | 15 ++++++++++++--- home-manager/default.nix | 3 ++- home-manager/p10k/p10k.zsh | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/darwin/modules/determinate-nix.nix b/darwin/modules/determinate-nix.nix index b017bdb6..b1ea2858 100644 --- a/darwin/modules/determinate-nix.nix +++ b/darwin/modules/determinate-nix.nix @@ -23,10 +23,9 @@ in system.activationScripts.determinateNix.text = '' if [ -f /etc/nix/nix.custom.conf ]; then tmp="$(mktemp)" - grep -v '^trusted-users *=.*$' /etc/nix/nix.custom.conf > "$tmp" || true + grep -Ev '^[[:space:]]*trusted-users[[:space:]]*=.*$' /etc/nix/nix.custom.conf > "$tmp" || true echo "trusted-users = root ${trustedUsers}" >> "$tmp" - cat "$tmp" > /etc/nix/nix.custom.conf - rm -f "$tmp" + mv "$tmp" /etc/nix/nix.custom.conf fi ''; }; diff --git a/flake.nix b/flake.nix index bf77d82a..46019e1a 100644 --- a/flake.nix +++ b/flake.nix @@ -34,9 +34,16 @@ user, arch ? "aarch64-darwin", configs ? [ ], + repoRoot ? "/Users/${user}/src/dotfiles", }: darwin.lib.darwinSystem { - specialArgs = { inherit user inputs; }; + specialArgs = { + inherit + user + inputs + repoRoot + ; + }; system = arch; modules = [ ./darwin/darwin.nix @@ -47,6 +54,7 @@ networking.localHostName = hostname; home-manager = { backupFileExtension = ".backup"; + extraSpecialArgs = { inherit repoRoot; }; users.${user} = import ./home-manager; }; users.users.${user}.home = "/Users/${user}"; @@ -118,10 +126,11 @@ }; formatter = forAllSystems (pkgs: pkgs.nixfmt); - devShells.aarch64-darwin.default = devShellFor "aarch64-darwin"; + devShells = nixpkgs.lib.genAttrs systems (system: { + default = devShellFor system; + }); # For CI lint on linux runners - devShells.x86_64-linux.default = devShellFor "x86_64-linux"; checks = forAllSystems (pkgs: { treefmt = mkCheck pkgs "treefmt-check" diff --git a/home-manager/default.nix b/home-manager/default.nix index 9b83c057..23c1a463 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -2,6 +2,7 @@ pkgs, lib, config, + repoRoot, ... }: @@ -16,7 +17,7 @@ xdg.configFile."ghostty/config".source = ./../.config/ghostty/config; xdg.configFile."direnv/direnv.toml".source = ./../.config/direnv/direnv.toml; xdg.configFile."zed/settings.json".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/src/dotfiles/.config/zed/settings.json"; + config.lib.file.mkOutOfStoreSymlink "${repoRoot}/.config/zed/settings.json"; xdg.configFile."starship.toml".source = ./../.config/starship.toml; home = { diff --git a/home-manager/p10k/p10k.zsh b/home-manager/p10k/p10k.zsh index d8abb299..b6c64c95 100644 --- a/home-manager/p10k/p10k.zsh +++ b/home-manager/p10k/p10k.zsh @@ -1,5 +1,5 @@ # Skip p10k config when using a different prompt theme -[[ ${PROMPT_THEME:-p10k} == p10k ]] || return +[[ ${PROMPT_THEME:-p10k} == p10k ]] || return 0 # Generated by Powerlevel10k configuration wizard on 2025-02-15 at 10:24 CST. # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 37983. From e5bac573e5612adaabc3178ade5c2e45b136b6d3 Mon Sep 17 00:00:00 2001 From: Chris Samuel Date: Sat, 14 Mar 2026 19:12:47 -0500 Subject: [PATCH 11/11] remove confusing comment --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 46019e1a..7363b9c9 100644 --- a/flake.nix +++ b/flake.nix @@ -130,7 +130,6 @@ default = devShellFor system; }); - # For CI lint on linux runners checks = forAllSystems (pkgs: { treefmt = mkCheck pkgs "treefmt-check"