From 53c6bf735dac38ef295a3ab671844e2a8c77d73e Mon Sep 17 00:00:00 2001 From: Matthew Bessette Date: Tue, 28 Jul 2026 02:51:16 -0400 Subject: [PATCH] Hydrogen got the changes applied --- caesium.home.nix | 2 + cleo.home.nix | 11 +--- config.claude.json | 9 +-- config.vscode.settings.json | 2 +- flake.nix | 19 ++++--- home.shared.nix | 16 +++--- hydrogen.darwin.nix | 54 ++++++++---------- hydrogen.home.nix | 107 +----------------------------------- variables.nix | 9 ++- 9 files changed, 61 insertions(+), 168 deletions(-) diff --git a/caesium.home.nix b/caesium.home.nix index 768a0ca..4ec1d93 100644 --- a/caesium.home.nix +++ b/caesium.home.nix @@ -26,6 +26,8 @@ userSettings = builtins.fromJSON (builtins.readFile ./config.vscode.settings.json); extensions = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [ bbenoist.nix + vscode-icons-team.vscode-icons + waderyan.gitblame ]; }; }; diff --git a/cleo.home.nix b/cleo.home.nix index 7806cfa..886d623 100644 --- a/cleo.home.nix +++ b/cleo.home.nix @@ -44,12 +44,6 @@ in oldPkgs.yarn ]; - # Enable direnv for automatic environment switching - programs.direnv = { - enable = true; - nix-direnv.enable = true; # Better Nix flakes integration with caching - }; - # Managed VS Code Extensions (The "Clean" Way) programs.vscode = { enable = true; @@ -58,18 +52,15 @@ in extensions = ( with pkgs.vscode-marketplace-release; [ bbenoist.nix - eamodio.gitlens graphql.vscode-graphql-syntax graphql.vscode-graphql - hashicorp.terraform ms-python.debugpy ms-python.python ms-python.vscode-pylance oxc.oxc-vscode - redhat.vscode-xml vscode-icons-team.vscode-icons typescriptteam.native-preview - lokalise.i18n-ally + waderyan.gitblame ] ) ++ ( with pkgs.vscode-marketplace; [ diff --git a/config.claude.json b/config.claude.json index 2d01ee7..fa21b22 100644 --- a/config.claude.json +++ b/config.claude.json @@ -1,5 +1,6 @@ { - "$schema": "https://json.schemastore.org/claude-code-settings.json", - "theme": "dark", - "agent": "plan" -} \ No newline at end of file + "$schema": "https://json.schemastore.org/claude-code-settings.json", + "theme": "dark", + "agent": "plan", + "denyCommands": ["code --install-extension*"] +} diff --git a/config.vscode.settings.json b/config.vscode.settings.json index 8615c48..7cde241 100644 --- a/config.vscode.settings.json +++ b/config.vscode.settings.json @@ -11,7 +11,7 @@ "extensions.autoUpdate": false, "extensions.autoCheckUpdates": false, "extensions.ignoreRecommendations": false, - + "denyCommands": ["code --install-extension*"], "[json]": { "editor.defaultFormatter": "biomejs.biome", "editor.formatOnSave": true diff --git a/flake.nix b/flake.nix index a3dc07a..b629a58 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ let linuxSystem = "x86_64-linux"; darwinSystem = "aarch64-darwin"; - userConfigs = import ./variables.nix; mkOverlays = sys: [ (final: prev: { unstable = import nixpkgsUnstable { @@ -118,16 +117,18 @@ # ------------------------------------------------------------- # Homemanager configuration # ------------------------------------------------------------- - homeConfigurations."mbessette@caesium" = home-manager.lib.homeManagerConfiguration { + homeConfigurations."mbessette@caesium" = let pkgs = import nixpkgs { system = linuxSystem; config.allowUnfree = true; overlays = mkOverlays linuxSystem; }; + in home-manager.lib.homeManagerConfiguration { + inherit pkgs; extraSpecialArgs = { system = linuxSystem; hostname = "caesium"; - userConfig = userConfigs."mbessette"; + userConfig = (import ./variables.nix { inherit pkgs; })."mbessette"; inherit inputs; }; modules = [ @@ -137,16 +138,18 @@ ]; }; - homeConfigurations."mbessette@hydrogen" = home-manager-darwin.lib.homeManagerConfiguration { + homeConfigurations."mbessette@hydrogen" = let pkgs = import nixpkgsUnstable { system = darwinSystem; config.allowUnfree = true; overlays = mkOverlays darwinSystem; }; + in home-manager-darwin.lib.homeManagerConfiguration { + inherit pkgs; extraSpecialArgs = { system = darwinSystem; hostname = "hydrogen"; - userConfig = userConfigs.mbessette; + userConfig = (import ./variables.nix { inherit pkgs; }).mbessette; inherit inputs; }; modules = [ @@ -156,16 +159,18 @@ ]; }; - homeConfigurations."matthew.bessette@cleo-darwin" = home-manager-darwin.lib.homeManagerConfiguration { + homeConfigurations."matthew.bessette@cleo-darwin" = let pkgs = import nixpkgsUnstable { system = darwinSystem; config.allowUnfree = true; overlays = mkOverlays darwinSystem; }; + in home-manager-darwin.lib.homeManagerConfiguration { + inherit pkgs; extraSpecialArgs = { system = darwinSystem; hostname = "cleo-darwin"; - userConfig = userConfigs."matthew.bessette"; + userConfig = (import ./variables.nix { inherit pkgs; })."matthew.bessette"; inherit inputs; }; modules = [ diff --git a/home.shared.nix b/home.shared.nix index 4c1dec7..3c75e2b 100644 --- a/home.shared.nix +++ b/home.shared.nix @@ -1,4 +1,4 @@ -{ pkgs, hostname, userConfig, ... }: +{ config, lib, pkgs, hostname, userConfig, ... }: let onePassPath = if pkgs.stdenv.isDarwin then "${userConfig.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" @@ -7,13 +7,15 @@ let then pkgs."ghostty-bin" else pkgs.ghostty; in { - home.stateVersion = "26.05"; + home.stateVersion = lib.mkDefault "26.05"; home.username = userConfig.username; home.homeDirectory = userConfig.homeDirectory; home.sessionVariables.SSH_AUTH_SOCK = onePassPath; + home.sessionVariables.CLAUDE_CONFIG_DIR = "${config.xdg.configHome}/claude"; xdg.enable = true; xdg.configFile."ssh.conf".source = ./config.ssh.conf; + xdg.configFile."claude/settings.json".source = ./config.claude.json; xdg.configFile."1Password/ssh/agent.toml".text = '' [[ssh-keys]] item = "${userConfig._1PassKeyName}" @@ -26,10 +28,6 @@ in { autosuggestion.enable = true; syntaxHighlighting.enable = true; - initContent = '' - export SSH_AUTH_SOCK=~/.1password/agent.sock - ''; - shellAliases = { ll = "ls -l"; gst = "git status"; @@ -85,9 +83,9 @@ in { extraConfig = builtins.readFile ./config.ssh.conf; settings = { "*" = { - controlMaster = "auto"; - controlPath = "~/.ssh/master-%r@%h:%p"; - identityAgent = onePassPath; + ControlMaster = "auto"; + ControlPath = "~/.ssh/master-%r@%h:%p"; + IdentityAgent = "\"${onePassPath}\""; }; }; }; diff --git a/hydrogen.darwin.nix b/hydrogen.darwin.nix index f3f4b84..113942a 100644 --- a/hydrogen.darwin.nix +++ b/hydrogen.darwin.nix @@ -4,9 +4,6 @@ ids.gids.nixbld = 350; security.pam.services.sudo_local.touchIdAuth = true; - # 1Password SSH Socket - environment.variables.SSH_AUTH_SOCK = "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"; - # Set vim as default editor environment.variables.EDITOR = "vim"; environment.variables.VISUAL = "vim"; @@ -14,10 +11,31 @@ # Add Homebrew to PATH environment.systemPath = [ "/opt/homebrew/bin" "/opt/homebrew/sbin" ]; + environment.systemPackages = with pkgs; [ + vim + git + wget + curl + python3 + nodejs_26 + home-manager + fastfetch + ]; - # Biome config - environment.etc."biome.json".source = ./config.biome.json; - environment.etc."oxlintrc.json".source = ./config.oxlintrc.json; + homebrew = { + enable = true; + onActivation.cleanup = "uninstall"; + onActivation.autoUpdate = true; + onActivation.upgrade = true; + casks = [ + "1password" + "obsidian" + "signal" + "spotify" + "claude-code" + "claude" + ]; + }; system.primaryUser = "mbessette"; users.users."mbessette" = { @@ -25,30 +43,6 @@ home = "/Users/mbessette"; }; - # Homebrew for Casks and specific binaries - # In a nix-darwin setup, Homebrew packages are not actually stored inside the Nix store. - # Instead, nix-darwin acts as a manager that triggers the standard Homebrew installation - # process on your macOS system. - homebrew = { - enable = true; - onActivation.cleanup = "uninstall"; - onActivation.autoUpdate = true; - onActivation.upgrade = true; - taps = [ "deskflow/tap" ]; - brews = [ - "biome" - ]; - casks = [ - "1password" - "deskflow" - "iterm2" - "moonlight" - "obsidian" - "signal" - "spotify" - ]; - }; - nix.settings.experimental-features = "nix-command flakes"; system.stateVersion = 4; } diff --git a/hydrogen.home.nix b/hydrogen.home.nix index 77a5af5..8503bde 100644 --- a/hydrogen.home.nix +++ b/hydrogen.home.nix @@ -1,86 +1,18 @@ -{ config, pkgs, ... }: { - home.stateVersion = "23.11"; - - home.username = "mbessette"; - home.homeDirectory = "/Users/mbessette"; - - home.packages = with pkgs; [ - # Dev Specs - python3 - pipenv - nodejs_22 - ]; - - # Enable direnv for automatic environment switching - programs.direnv = { - enable = true; - nix-direnv.enable = true; # Better Nix flakes integration with caching - }; +{ config, inputs, pkgs, ... }: { # Managed VS Code Extensions (The "Clean" Way) programs.vscode = { enable = true; profiles.default = { userSettings = builtins.fromJSON (builtins.readFile ./config.vscode.settings.json); - extensions = with pkgs.vscode-marketplace; [ - biomejs.biome + extensions = with inputs.nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [ bbenoist.nix - eamodio.gitlens - github.copilot-chat - graphql.vscode-graphql-syntax - hashicorp.terraform - mechatroner.rainbow-csv - mermaidchart.vscode-mermaid-chart - ms-python.debugpy - ms-python.python - ms-python.vscode-pylance - oxc.oxc-vscode - redhat.vscode-xml vscode-icons-team.vscode-icons - typescriptteam.native-preview + waderyan.gitblame ]; }; }; - # Automatically load the 1Password agent in your shell - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - oh-my-zsh.enable = true; - oh-my-zsh.theme = "robbyrussell"; - oh-my-zsh.plugins = [ - "git" - "npm" - ]; - - initContent = '' - export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock - - # Auto-allow direnv for directories with flake.nix - auto_allow_direnv() { - if [[ -f flake.nix ]] && [[ ! -f .envrc ]]; then - echo "use flake" > .envrc - direnv allow - elif [[ -f flake.nix ]] && [[ -f .envrc ]]; then - direnv allow - fi - } - - # Run auto-allow when changing directories - chpwd_functions+=(auto_allow_direnv) - ''; - - shellAliases = { - ll = "ls -l"; - update = "sudo darwin-rebuild switch --flake ~/nixos#hydrogen"; - laws = "aws --endpoint=http://localhost:4566"; - dev = "nix develop -c $SHELL"; - nixos = "code ~/nixos"; - }; - }; - home.sessionVariables = { # Points to the Homebrew location mentioned in your caveat NPM_CONFIG_PREFIX = "${config.home.homeDirectory}/.npm-global"; @@ -93,37 +25,4 @@ home.file.".npmrc".text = '' prefix=${config.home.homeDirectory}/.npm-global '' ; - - home.file.".config/1Password/ssh/agent.toml".source = ./config.agent.toml; - - programs.ssh = { - enable = true; - matchBlocks = { - "thiccdata.io" = { - hostname = "192.168.1.45"; - user = "mbessette"; - port = 2222; - }; - "*" = { - extraOptions = { - "IdentityAgent" = "\"~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock\""; - }; - }; - }; - }; - - programs.git = { - enable = true; - - settings.user = { - name = "Matthew Bessette"; - email = "bessette.matthew94@gmail.com"; - }; - - settings.init.defaultBranch = "main"; - - # This creates ~/.config/git/ignore and sets core.excludesFile - ignores = [ - ]; - }; } diff --git a/variables.nix b/variables.nix index 993cfee..4d89c9f 100644 --- a/variables.nix +++ b/variables.nix @@ -1,7 +1,10 @@ -{ +{ pkgs }: +let + homePrefix = if pkgs.stdenv.isDarwin then "/Users" else "/home"; +in { mbessette = { username = "mbessette"; - homeDirectory = "/home/mbessette"; + homeDirectory = "${homePrefix}/mbessette"; gitName = "Matthew Bessette"; gitEmail = "blade30912@gmail.com"; _1PassKeyName = "Personal SSH Key"; @@ -9,7 +12,7 @@ }; "matthew.bessette" = { username = "matthew.bessette"; - homeDirectory = "/home/matthew.bessette"; + homeDirectory = "${homePrefix}/matthew.bessette"; gitName = "Matthew Bessette"; gitEmail = "matthew.bessette@hicleo.com"; _1PassKeyName = "Cleo SSH Key";