diff --git a/nix/flake.nix b/nix/flake.nix index 02d6228..3d88645 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -20,5 +20,13 @@ ./hosts/sbpltt6cllvdl/default.nix ]; }; + darwinConfigurations."sbplt4w6p3hjt" = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + + modules = [ + home-manager.darwinModules.home-manager + ./hosts/sbplt4w6p3hjt/default.nix + ]; + }; }; } diff --git a/nix/hosts/sbplt4w6p3hjt/default.nix b/nix/hosts/sbplt4w6p3hjt/default.nix new file mode 100644 index 0000000..f630d4b --- /dev/null +++ b/nix/hosts/sbplt4w6p3hjt/default.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: + +let + imports = [ + ./homebrew.nix + ]; + +in { + + inherit imports; + + # Make sure the nix daemon always runs + services.nix-daemon.enable = true; + + # Fonts + fonts.fontDir.enable = true; + fonts.fonts = with pkgs; [ + recursive + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + ]; + + # If you use zsh you'll need to enable this so nix-darwin creates a zshrc sourcing needed environment changes + programs.zsh.enable = true; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users."shoekstra" = import ../../users/shoekstra/home.nix; + + # This needs to be to set for things to work (see https://github.com/LnL7/nix-darwin/issues/423) + users.users."shoekstra" = { + home = "/Users/shoekstra"; + }; +} diff --git a/nix/hosts/sbplt4w6p3hjt/homebrew.nix b/nix/hosts/sbplt4w6p3hjt/homebrew.nix new file mode 100644 index 0000000..eb94e1f --- /dev/null +++ b/nix/hosts/sbplt4w6p3hjt/homebrew.nix @@ -0,0 +1,10 @@ +{ + homebrew.enable = true; + + homebrew.casks = [ + "iterm2" + "spotify" + "telegram" + "whatsapp" + ]; +} diff --git a/nix/users/shoekstra/home.nix b/nix/users/shoekstra/home.nix index c2a2628..6f07f46 100644 --- a/nix/users/shoekstra/home.nix +++ b/nix/users/shoekstra/home.nix @@ -34,4 +34,44 @@ in { # Let Home Manager install and manage itself. programs.home-manager.enable = true; + + # Packages with modules to configure them. + programs = { + bat = { + enable = true; + + config.theme = "OneHalfDark"; + }; + + git = { + enable = true; + + userName = "Stephen Hoekstra"; + userEmail = "shoekstra@schubergphilis.com"; + + aliases = { + personal = "config user.email stephenhoekstra@gmail.com"; + unstage = "reset HEAD --"; + }; + + extraConfig = { + core.whitespace = "trailing-space,space-before-tab"; + credential.helper = "osxkeychain"; + }; + + signing.key = "DBB82B1442BFA582"; + }; + }; + + programs.gh-dash.enable = true; + programs.gh.enable = true; + programs.gpg.enable = true; + programs.htop.enable = true; + programs.k9s.enable = true; + + # Packages without modules to configure them. + home.packages = with pkgs; [ + mc + tree + ]; } diff --git a/nix/users/shoekstra/nvim.nix b/nix/users/shoekstra/nvim.nix index 53b0984..86b1c24 100644 --- a/nix/users/shoekstra/nvim.nix +++ b/nix/users/shoekstra/nvim.nix @@ -10,7 +10,7 @@ in { (python3.withPackages(ps: with ps; [ pynvim ])) # Packages used by neovim config - hadolint + # hadolint -- has a broken dependency, will look into it another time nodePackages.markdownlint-cli shellcheck tree-sitter diff --git a/nix/users/shoekstra/tmux.nix b/nix/users/shoekstra/tmux.nix index fe74399..0296316 100644 --- a/nix/users/shoekstra/tmux.nix +++ b/nix/users/shoekstra/tmux.nix @@ -7,17 +7,38 @@ let in { home.packages = with pkgs; [ reattach-to-user-namespace - tmux ]; - home.file = { - ".tmux.conf".source = pkgs.fetchFromGitHub { - owner = "gpakosz"; - repo = ".tmux"; - rev = "7706ab724f3811479a358c6f9ea6aeb6decece5f"; - sha256 = "sha256-o126SathIT49Mj9EZDhlYF5i3EgRe2HFZkoGXTVQBbw="; - } + "/.tmux.conf"; + programs.tmux = { + enable = true; + baseIndex = 1; + historyLimit = 50000; + keyMode = "vi"; + mouse = true; + prefix = "C-a"; + sensibleOnTop = false; + terminal = "xterm-256color"; - ".tmux.conf.local".source = lib.dotFilePath "tmux/tmux.conf.local"; + extraConfig = '' + # Switch to last window, screen style + bind-key a send-prefix + bind-key C-a last-window + + # Apply true color + set-option -ga terminal-overrides ",xterm-256color:Tc" + ''; + + plugins = with pkgs; [ + # Waiting for https://github.com/NixOS/nixpkgs/pull/191517 to be merged + (tmuxPlugins.sensible.overrideAttrs ( _: { + version = "unstable-2022-08-14"; + src = fetchFromGitHub { + owner = "tmux-plugins"; + repo = "tmux-sensible"; + rev = "25cb91f42d020f675bb0a2ce3fbd3a5d96119efa"; + sha256 = "sha256-sw9g1Yzmv2fdZFLJSGhx1tatQ+TtjDYNZI5uny0+5Hg="; + }; + })) + ]; }; } diff --git a/scripts/install.sh b/scripts/install.sh index f6e8505..4f3bfd9 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -6,6 +6,11 @@ for file in /etc/*.backup-before-nix; do [ -e "${file}" ] && sudo rm -v ${file} done +if [ -d "~/.config/nix" ]; then + mkdir -p ~/.config/nix + echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf +fi + curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install echo "==> Running first build..."