diff --git a/flake.nix b/flake.nix index b78ccfa..23b336f 100644 --- a/flake.nix +++ b/flake.nix @@ -151,6 +151,24 @@ } ]; }; + "msft-mac" = nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + specialArgs = { + inherit inputs ghostty self; + }; + modules = [ + ./hosts/msft-mac/configuration.nix + home-manager.darwinModules.home-manager + { + home-manager.extraSpecialArgs = { + pkgs-unstable = pkgs-unstable_aarch64-darwin; + }; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.uagm.imports = [ ./hosts/msft-mac/home.nix ]; + } + ]; + }; }; homeConfigurations = let diff --git a/home-modules/default.nix b/home-modules/default.nix index 032c2ce..8616e58 100644 --- a/home-modules/default.nix +++ b/home-modules/default.nix @@ -1,8 +1,8 @@ { pkgs, ... }: { home = { packages = with pkgs; [ - lua-language-server - neovim + fzf + ripgrep zip unzip eza @@ -12,7 +12,6 @@ programs.zsh = { shellAliases = { ls = "eza"; - n = "nvim"; }; }; } diff --git a/home-modules/nvim.nix b/home-modules/nvim.nix index 19200af..1ef68ab 100644 --- a/home-modules/nvim.nix +++ b/home-modules/nvim.nix @@ -15,6 +15,7 @@ with lib; config = mkIf config.nvim.enable { home.packages = [ + pkgs.lua-language-server config.nvim.package ]; diff --git a/home-modules/tmux-darwin.nix b/home-modules/tmux-darwin.nix deleted file mode 100644 index 1f6d271..0000000 --- a/home-modules/tmux-darwin.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ pkgs, ... }: { - - home = { - packages = with pkgs; [ - tmux - ]; - }; - - programs.zsh = { - shellAliases = { - t = "tmux"; - ta = "tmux attach -t"; - tns = "tmux new-session -t"; - tks = "tmux kill-session -t"; - }; - }; - - programs.tmux = { - enable = true; - mouse = true; - prefix = "C-a"; - terminal = "screen-256color"; - historyLimit = 5000; - baseIndex = 1; - escapeTime = 10; - customPaneNavigationAndResize = true; - sensibleOnTop = false; - extraConfig = '' - set -ga terminal-overrides ",xterm-256color*:Tc" - # Keep path when creating a new window. - bind c new-window -c "#{pane_current_path}" - - # Better splits - bind-key "|" split-window -h -c "#{pane_current_path}" - bind-key "\\" split-window -fh -c "#{pane_current_path}" - bind-key "-" split-window -v -c "#{pane_current_path}" - bind-key "_" split-window -fv -c "#{pane_current_path}" - - # Toggle last windows - bind Space last-window - bind -r p previous-window - bind -r f next-window - - # Movement - bind -r e select-pane -U - bind -r n select-pane -D - bind -r m select-pane -L - bind -r i select-pane -R - - # Resizing this will not work with colemak keymaps. - bind -r C-j resize-pane -D 15 - bind -r C-k resize-pane -U 15 - bind -r C-h resize-pane -L 15 - bind -r C-l resize-pane -R 15 - - # Kill panes and windows - bind w kill-pane - bind W kill-window - - # Pane sync - unbind s - unbind S - bind s setw synchronize-panes on - bind S setw synchronize-panes off - ''; - plugins = with pkgs; [ - { - plugin = tmuxPlugins.resurrect; - extraConfig = "set -g @resurrect-strategy-nvim 'session'"; - } - { - plugin = tmuxPlugins.continuum; - extraConfig = '' - set -g @continuum-restore 'on' - set -g @continuum-save-interval '1' # minutes - ''; - } - ]; - }; - -} diff --git a/home-modules/tmux.nix b/home-modules/tmux.nix index 31bea1c..dd4abd7 100644 --- a/home-modules/tmux.nix +++ b/home-modules/tmux.nix @@ -24,6 +24,7 @@ baseIndex = 1; escapeTime = 10; customPaneNavigationAndResize = true; + sensibleOnTop = !pkgs.stdenv.isDarwin; extraConfig = '' set -ga terminal-overrides ",xterm-256color*:Tc" # Keep path when creating a new window. diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 7aa4f99..1fc6a34 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -6,16 +6,21 @@ } : { imports = [ - ../../home-modules/tmux-darwin.nix + ../../home-modules/tmux.nix ../../home-modules/lazygit.nix ../../home-modules/zsh.nix ../../home-modules/starship.nix ../../home-modules/nvim.nix ../../home-modules/direnv.nix # I should update the module with an option for adding winodow decorations. - ../../home-modules/ghostty-mac-config.nix + ../../home-modules/ghostty-config.nix ]; + ghostty = { + font-size = "17.2"; + window-decoration = true; + }; + nvim = { enable = true; package = pkgs-unstable.neovim; diff --git a/hosts/msft-mac/configuration.nix b/hosts/msft-mac/configuration.nix new file mode 100644 index 0000000..20166e4 --- /dev/null +++ b/hosts/msft-mac/configuration.nix @@ -0,0 +1,53 @@ +{ self, pkgs, ... }: { + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; [ + neofetch + ]; + + system.primaryUser = "jmug"; + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + cleanup = "uninstall"; + upgrade = true; + }; + + caskArgs = { + no_quarantine = true; + }; + + taps = []; + brews = [ + ]; + casks = [ + "ghostty" + "secretive" + ]; + }; + + fonts.packages = with pkgs; [ + nerd-fonts.bigblue-terminal + ]; + + users.users.jmug.home = "/Users/jmug"; + + nixpkgs.config.allowUnfree = true; + + programs.zsh.enable = true; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + + # Set Git commit hash for darwin-version. + system.configurationRevision = self.rev or self.dirtyRev or null; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 6; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/hosts/msft-mac/home.nix b/hosts/msft-mac/home.nix new file mode 100644 index 0000000..68983f9 --- /dev/null +++ b/hosts/msft-mac/home.nix @@ -0,0 +1,88 @@ +{ + config, + pkgs, + pkgs-unstable, + ... +} : { + + imports = [ + ../../home-modules/default.nix + ../../home-modules/direnv.nix + ../../home-modules/ghostty-config.nix + ../../home-modules/lazygit.nix + ../../home-modules/nvim.nix + ../../home-modules/starship.nix + ../../home-modules/tmux.nix + ../../home-modules/zsh.nix + ]; + + ghostty = { + font-size = "17.2"; + window-decoration = true; + }; + + nvim = { + enable = true; + package = pkgs-unstable.neovim; + }; + + home = { + username = "jmug"; + homeDirectory = "/Users/jmug"; + + packages = with pkgs; [ + jq + yq + nerd-fonts.bigblue-terminal + nerd-fonts.fira-code + + go + gopls + gotools + mockgen + pkgs-unstable.kubernetes-controller-tools + pkgs-unstable.kubectl + pkgs-unstable.kubectl-node-shell + pkgs-unstable.kind + pkgs-unstable.kubernetes-helm + + pkgs-unstable.azure-cli + + pkgs-unstable.claude-code + (pkgs-unstable.litellm.overrideAttrs (oldAttrs: rec { + version = "1.74.9"; + src = pkgs.fetchFromGitHub { + owner = "BerriAI"; + repo = "litellm"; + tag = "v${version}-stable"; + hash = "sha256-SGZwt2jzAQbOMlvudqPWat281su6OwT7JG2CNSMjL3A="; + }; + })) + ]; + + stateVersion = "25.05"; + }; + + programs.zsh = { + shellAliases = { + # TODO BEGIN Interpolate the name of the host here. + flakeconf = "nvim /Users/jmug/nixos/flake.nix"; + sysconf = "nvim /Users/jmug/nixos/hosts/macbook/configuration.nix"; + homeconf = "nvim /Users/jmug/nixos/hosts/macbook/home.nix"; + nvconf = "nvim /Users/jmug/nixos/home-modules/explicit-configs/nvim/init.lua"; + # TODO: Interpolate the name of the host here. + radev = "/Users/jmug/dev/aks-rp/bin/aksdev"; + ksc = "KUBECONFIG=/Users/jmug/Downloads/cxkubeconfig.yaml kubectl"; + kso = "KUBECONFIG=/Users/jmug/Downloads/overlaykubeconfig.yaml kubectl"; + k = "kubectl"; + nrsw = "sudo darwin-rebuild switch --flake /Users/jmug/nixos#msft-mac"; + }; + initExtra = '' + export GONOPROXY='github.com,golang.org,googlesource.com,opentelemetry.io,uber.org' + export GOPRIVATE='goms.io,*.goms.io' + export GOPROXY='https://goproxyprod.goms.io' + export PATH=$PATH:$HOME/bin + export PATH=$PATH:$HOME/go/bin + ''; + }; +} diff --git a/users/nixlapmsft/home.nix b/users/nixlapmsft/home.nix index 67a7325..daa4de3 100644 --- a/users/nixlapmsft/home.nix +++ b/users/nixlapmsft/home.nix @@ -3,13 +3,13 @@ { imports = [ ../../home-modules/default.nix - ../../home-modules/nvim.nix - ../../home-modules/tmux.nix - ../../home-modules/lazygit.nix - ../../home-modules/starship.nix ../../home-modules/direnv.nix - ../../home-modules/zsh.nix ../../home-modules/ghostty-mac-config.nix + ../../home-modules/lazygit.nix + ../../home-modules/nvim.nix + ../../home-modules/starship.nix + ../../home-modules/tmux.nix + ../../home-modules/zsh.nix ]; nixGL.packages = nixgl.packages;