From 273396aa9922f1354b70db140b6b16c4da24a91a Mon Sep 17 00:00:00 2001 From: Matthew Bessette Date: Sun, 5 Apr 2026 00:54:01 -0400 Subject: [PATCH] homeman --- caesium.home.nix | 119 ++++++++++++++++++++++++++++++++++++++++++++++ caesium.nixos.nix | 4 +- flake.nix | 9 ++++ 3 files changed, 131 insertions(+), 1 deletion(-) diff --git a/caesium.home.nix b/caesium.home.nix index e69de29..77cc67f 100644 --- a/caesium.home.nix +++ b/caesium.home.nix @@ -0,0 +1,119 @@ +{ config, pkgs, ... }: { + home.stateVersion = "23.11"; + + home.username = "mbessette"; + home.homeDirectory = "/Users/mbessette"; + + home.packages = with pkgs; []; + + programs.home-manager.enable = true; + # 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; + profiles.default = { + userSettings = builtins.fromJSON (builtins.readFile ./config.vscode.settings.json); + extensions = with pkgs.vscode-marketplace; [ + bbenoist.nix + eamodio.gitlens + github.copilot-chat + graphql.vscode-graphql-syntax + hashicorp.terraform + mechatroner.rainbow-csv + mermaidchart.vscode-mermaid-chart + redhat.vscode-xml + vscode-icons-team.vscode-icons + typescriptteam.native-preview + ]; + }; + }; + + # 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#caesium"; + dev = "nix develop -c $SHELL"; + nixos = "code ~/nixos"; + }; + }; + + home.sessionVariables = { + # Points to the Homebrew location mentioned in your caveat + NPM_CONFIG_PREFIX = "/usr/local/Projects/.npm-global/.npm-global"; + }; + + home.sessionPath = [ + "/usr/local/Projects/.npm-global/bin" + ]; + + home.file.".npmrc".text = '' + prefix=/usr/local/Projects/.npm-global/.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/caesium.nixos.nix b/caesium.nixos.nix index 5a529ad..ce8ab4a 100644 --- a/caesium.nixos.nix +++ b/caesium.nixos.nix @@ -5,6 +5,7 @@ ./caesium.hardware.nix # Crucial: Imports your UUIDs ]; + time.timeZone = "America/New_York"; nixpkgs.config.allowUnfree = true; nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -96,7 +97,8 @@ git wget curl - bottles + bottles + _1password-gui ]; # --- SYSTEM VERSION --- diff --git a/flake.nix b/flake.nix index e10a4d3..6d1f683 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,15 @@ { nixpkgs.config.allowUnfree = true; } + # The Home Manager NixOS module + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + home-manager.users."mbessette" = import ./caesium.home.nix; + home-manager.backupFileExtension = "before-nix"; + } ]; };