Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Migrate home/ to module system

+635 -407
+10 -2
home/apps/default.nix
··· 1 - { ... }: 1 + { lib, ... }: 2 2 3 - { 3 + with lib; { 4 + options.modules.apps = { 5 + enable = mkOption { 6 + default = true; 7 + description = "Whether to enable Apps options."; 8 + type = types.bool; 9 + }; 10 + }; 11 + 4 12 imports = [ 5 13 ./firefox.nix 6 14 ./obsidian.nix
+18 -3
home/apps/firefox.nix
··· 1 - { helpers, ... }: 1 + { lib, config, helpers, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.apps; 6 + in { 7 + options.modules.apps.firefox = { 8 + enable = mkOption { 9 + default = false; 10 + description = "Whether to enable Firefox."; 11 + type = types.bool; 12 + }; 13 + }; 2 14 3 - { 4 - config = helpers.mkIfLinux { 15 + config.modules.apps.firefox = { 16 + enable = if helpers.isLinux then (mkDefault false) else (mkForce false); 17 + }; 18 + } // helpers.linuxAttrs { 19 + config = mkIf (cfg.enable && cfg.firefox.enable) { 5 20 programs.firefox = { 6 21 enable = true; 7 22 profiles.default = {
+16 -3
home/apps/obsidian.nix
··· 1 - { pkgs, ... }: 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.apps; 6 + in { 7 + options.modules.apps.obsidian = { 8 + enable = mkOption { 9 + default = false; 10 + description = "Whether to enable Obsidian."; 11 + type = types.bool; 12 + }; 13 + }; 2 14 3 - { 4 - home.packages = [pkgs.obsidian]; 15 + config = mkIf (cfg.enable && cfg.obsidian.enable) { 16 + home.packages = [pkgs.obsidian]; 17 + }; 5 18 }
+17 -5
home/apps/ollama.nix
··· 1 - { helpers, lib, pkgs, ... }: 1 + { lib, config, helpers, pkgs, ... }: 2 2 3 + with lib; 3 4 let 5 + cfg = config.modules.apps; 4 6 ollamaArgs = [ 5 7 "${pkgs.ollama}/bin/ollama" 6 8 "serve" 7 9 ]; 8 10 in { 9 - config = lib.mkMerge [ 10 - { home.packages = [ pkgs.ollama ]; } 11 + options.modules.apps.ollama = { 12 + enable = mkOption { 13 + default = false; 14 + description = "Whether to enable Ollama."; 15 + type = types.bool; 16 + }; 17 + }; 18 + 19 + config = mkIf (cfg.enable && cfg.ollama.enable) (mkMerge [ 20 + { 21 + home.packages = [ pkgs.ollama ]; 22 + } 11 23 12 24 (helpers.mkIfLinux { 13 25 systemd.user.services.ollama = { ··· 17 29 }; 18 30 Install.WantedBy = [ "default.target" ]; 19 31 Service = { 20 - ExecStart = lib.escapeShellArgs ollamaArgs; 32 + ExecStart = escapeShellArgs ollamaArgs; 21 33 Restart = "on-failure"; 22 34 RestartSec = 5; 23 35 }; ··· 37 49 }; 38 50 }; 39 51 }) 40 - ]; 52 + ]); 41 53 }
+18 -5
home/apps/wezterm/default.nix
··· 1 - { pkgs, helpers, lib, ... } @ inputs: 1 + { lib, config, pkgs, helpers, ... } @ inputs: 2 2 3 + with lib; 3 4 let 4 5 inherit (pkgs) stdenv; 5 6 inherit (import ../../../lib/colors.nix inputs) colors mkLuaSyntax; 6 7 8 + cfg = config.modules.apps; 9 + 7 10 wezterm = pkgs.wezterm.overrideAttrs (_: { 8 - preFixup = lib.optionalString stdenv.isLinux '' 11 + preFixup = optionalString stdenv.isLinux '' 9 12 patchelf \ 10 13 --add-needed "${pkgs.libGL}/lib/libEGL.so.1" \ 11 14 --add-needed "${pkgs.vulkan-loader}/lib/libvulkan.so.1" \ ··· 31 34 source "${wezterm}/etc/profile.d/wezterm.sh" 32 35 ''; 33 36 in { 34 - home.packages = [ wezterm ]; 35 - xdg.configFile."wezterm/wezterm.lua".text = configStr; 36 - programs.zsh.initExtra = shellIntegrationStr; 37 + options.modules.apps.wezterm = { 38 + enable = mkOption { 39 + default = false; 40 + description = "Whether to enable Wezterm."; 41 + type = types.bool; 42 + }; 43 + }; 44 + 45 + config = mkIf (cfg.enable && cfg.wezterm.enable) { 46 + home.packages = [ wezterm ]; 47 + xdg.configFile."wezterm/wezterm.lua".text = configStr; 48 + programs.zsh.initExtra = shellIntegrationStr; 49 + }; 37 50 }
+4
home/base/default.nix
··· 3 3 { 4 4 imports = [ 5 5 ./nix-config.nix 6 + ./gpg.nix 7 + ./git.nix 8 + ./shell.nix 9 + ./tmux.nix 6 10 ]; 7 11 }
+153
home/base/git.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.git; 6 + home = config.home.homeDirectory; 7 + 8 + userType = types.submodule { 9 + options = { 10 + name = mkOption { 11 + type = types.str; 12 + example = "Sample Name"; 13 + }; 14 + email = mkOption { 15 + type = types.str; 16 + example = "sample@name.com"; 17 + }; 18 + }; 19 + }; 20 + in { 21 + options.modules.git = { 22 + enable = mkOption { 23 + default = true; 24 + description = "Git Configuration"; 25 + type = types.bool; 26 + }; 27 + 28 + user = mkOption { 29 + default = { 30 + name = "Phil Pluckthun"; 31 + email = "phil@kitten.sh"; 32 + }; 33 + description = "Git user information"; 34 + type = userType; 35 + }; 36 + 37 + signingKey = mkOption { 38 + description = "Git Signing key"; 39 + type = types.nullOr types.str; 40 + }; 41 + }; 42 + 43 + config = mkIf cfg.enable { 44 + home.packages = with pkgs; [ git-crypt git-get ]; 45 + 46 + programs.git = { 47 + enable = true; 48 + userName = cfg.user.name; 49 + userEmail = cfg.user.email; 50 + 51 + signing = mkIf (cfg.signingKey != null) { 52 + signByDefault = true; 53 + key = cfg.signingKey; 54 + }; 55 + 56 + ignores = [ 57 + ".DS_Store" 58 + "*.sw[nop]" 59 + "*.undodir" 60 + ".env" 61 + "*.orig" 62 + ]; 63 + 64 + lfs = { 65 + enable = true; 66 + }; 67 + 68 + aliases = { 69 + s = "status -s"; 70 + last = "log -1"; 71 + lol = "log --pretty=longline"; 72 + recommit = "commit -a --amend --no-edit"; 73 + pushf = "push --force-with-lease"; 74 + glog = "log --pretty=longline --decorate --all --graph --date=relative"; 75 + journal = "!f() { git commit -a -m \"$(date +'%Y-%m-%d %H:%M:%S')\"; }; f"; 76 + }; 77 + 78 + extraConfig = { 79 + commit.gpgSign = true; 80 + tag.gpgSign = true; 81 + push.gpgSign = "if-asked"; 82 + 83 + color.ui = "auto"; 84 + init.defaultBranch = "main"; 85 + 86 + branch.sort = "-committerdate"; 87 + tag.sort = "-taggerdate"; 88 + 89 + status = { 90 + showUntrackedFiles = "all"; 91 + submoduleSummary = true; 92 + }; 93 + 94 + diff = { 95 + tool = "vimdiff"; 96 + submodule = "log"; 97 + algorithm = "histogram"; 98 + colorMovedWS = "allow-indentation-change"; 99 + compactionHeuristic = true; 100 + context = 10; 101 + }; 102 + 103 + push = { 104 + default = "simple"; 105 + autoSetupRemote = true; 106 + followtags = true; 107 + }; 108 + 109 + rebase = { 110 + autosquash = true; 111 + autostash = true; 112 + updateRefs = true; 113 + missingCommitsCheck = "error"; 114 + }; 115 + 116 + merge = { 117 + ff = "only"; 118 + tool = "vimdiff"; 119 + keepbackup = false; 120 + }; 121 + 122 + fetch = { 123 + prune = true; 124 + prunetags = true; 125 + }; 126 + 127 + gitget = { 128 + root = "${home}/git"; 129 + host = "github.com"; 130 + skip-host = true; 131 + }; 132 + 133 + core.autocrlf = false; 134 + pull.rebase = true; 135 + rerere.enabled = true; 136 + difftool.prompt = false; 137 + mergetool.prompt = true; 138 + transfer.fsckobjects = true; 139 + fetch.fsckobjects = true; 140 + receive.fsckObjects = true; 141 + submodule.recurse = true; 142 + 143 + "mergetool \"vimdiff\"".cmd = "nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"; 144 + pretty.longline = "tformat:%Cgreen%h %Cred%D %Creset%s %Cblue(%cd, by %an)"; 145 + 146 + "remote \"origin\"" = { 147 + fetch = "+refs/pull/*/head:refs/remotes/origin/pr/*"; 148 + pruneTags = true; 149 + }; 150 + }; 151 + }; 152 + }; 153 + }
+48
home/base/gpg.nix
··· 1 + { lib, config, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.gpg; 6 + home = config.home.homeDirectory; 7 + in { 8 + options.modules.gpg = { 9 + enable = mkOption { 10 + default = true; 11 + description = "GnuPG"; 12 + type = types.bool; 13 + }; 14 + }; 15 + 16 + config = mkIf cfg.enable { 17 + modules.git.signingKey = mkDefault "303B6A9A312AA035"; 18 + 19 + age.secrets."pubring.kbx" = { 20 + symlink = true; 21 + path = "${home}/.gnupg/pubring.kbx"; 22 + file = ./encrypt/pubring.kbx.age; 23 + }; 24 + 25 + age.secrets."75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key" = { 26 + symlink = true; 27 + path = "${home}/.gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key"; 28 + file = ./encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age; 29 + }; 30 + 31 + age.secrets."E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key" = { 32 + symlink = true; 33 + path = "${home}/.gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key"; 34 + file = ./encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age; 35 + }; 36 + 37 + age.secrets."CA84692E3CC846C8EC7272468E962B63FC599E49.key" = { 38 + symlink = true; 39 + path = "${home}/.gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key"; 40 + file = ./encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age; 41 + }; 42 + 43 + home.file.".gnupg/sshcontrol".text = '' 44 + E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6 45 + 75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7 46 + ''; 47 + }; 48 + }
+4 -2
home/base/nix-config.nix
··· 1 1 { config, ... }: 2 2 3 - { 3 + let 4 + home = config.home.homeDirectory; 5 + in { 4 6 age.secrets."nix-access-tokens.conf" = { 5 7 symlink = true; 6 - path = "${config.home.homeDirectory}/.cache/nix-access-tokens.conf"; 8 + path = "${home}/.cache/nix-access-tokens.conf"; 7 9 file = ../../modules/base/encrypt/nix-access-tokens.conf.age; 8 10 }; 9 11
+106
home/base/shell.nix
··· 1 + { lib, config, pkgs, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.shell; 6 + in { 7 + options.modules.shell = { 8 + enable = mkOption { 9 + default = true; 10 + description = "Shell"; 11 + type = types.bool; 12 + }; 13 + 14 + enableStarship = mkOption { 15 + default = cfg.enable; 16 + description = "Starship"; 17 + type = types.bool; 18 + }; 19 + }; 20 + 21 + config = mkIf cfg.enable { 22 + programs.zsh = { 23 + enable = true; 24 + enableAutosuggestions = true; 25 + 26 + enableCompletion = false; 27 + 28 + shellAliases = { 29 + ls = "ls --color=auto"; 30 + ll = "ls -l"; 31 + wx = "wezmux"; 32 + http = "xh"; 33 + }; 34 + 35 + initExtra = '' 36 + function update_title_preexec { 37 + emulate -L zsh 38 + setopt extended_glob 39 + local title=''${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} 40 + printf "\e]0;%s\e\\" "$title" 41 + } 42 + function update_title_precmd { 43 + emulate -L zsh 44 + setopt extended_glob 45 + local title=''${PWD##*/} 46 + printf "\e]0;%s\e\\" "$title" 47 + } 48 + 49 + add-zsh-hook preexec update_title_preexec 50 + add-zsh-hook precmd update_title_precmd 51 + ''; 52 + 53 + plugins = [ 54 + { 55 + name = "zsh-syntax-highlighting"; 56 + src = pkgs.fetchFromGitHub { 57 + owner = "zsh-users"; 58 + repo = "zsh-syntax-highlighting"; 59 + rev = "91d2eeaf23c47341e8dc7ad66dbf85e38c2674de"; 60 + sha256 = "1160bbhpd2p6qlw1b5k86z243iv0yhv6x7pf414sr8q4cm59x2h0"; 61 + }; 62 + } 63 + ]; 64 + }; 65 + 66 + programs.direnv = { 67 + enable = true; 68 + enableZshIntegration = true; 69 + nix-direnv.enable = true; 70 + }; 71 + 72 + programs.zoxide = { 73 + enable = true; 74 + enableZshIntegration = true; 75 + enableNushellIntegration = mkDefault false; 76 + enableFishIntegration = mkDefault false; 77 + }; 78 + 79 + programs.starship = mkIf cfg.enableStarship { 80 + enable = true; 81 + enableZshIntegration = true; 82 + 83 + settings = { 84 + add_newline = false; 85 + gcloud.disabled = true; 86 + aws.disabled = true; 87 + cmd_duration.disabled = true; 88 + battery.disabled = true; 89 + nodejs.disabled = true; 90 + deno.disabled = true; 91 + character.success_symbol = "[➜](green)"; 92 + character.error_symbol = "[➜](bold red)"; 93 + git_branch.symbol = " "; 94 + git_commit.tag_symbol = " "; 95 + git_status.format = "([$all_status]($style))"; 96 + git_status.conflicted = " "; 97 + git_status.untracked = " "; 98 + git_status.modified = " "; 99 + git_status.staged = " "; 100 + git_status.deleted = " "; 101 + git_status.renamed = " "; 102 + git_status.stashed = " "; 103 + }; 104 + }; 105 + }; 106 + }
+98
home/base/tmux.nix
··· 1 + { lib, config, pkgs, ... } @ inputs: 2 + 3 + with lib; 4 + let 5 + inherit (pkgs) stdenv; 6 + inherit (import ../../lib/colors.nix inputs) colors; 7 + 8 + cfg = config.modules.git; 9 + 10 + defaultActiveColor = colors.yellow.gui; 11 + defaultInactiveColor = colors.muted.gui; 12 + defaultFeatureColor = colors.blue.gui; 13 + defaultBorderColor = colors.green.gui; 14 + defaultSplitColor = colors.split.gui; 15 + in { 16 + options.modules.tmux = { 17 + enable = mkOption { 18 + default = true; 19 + description = "Tmux Configuration"; 20 + type = types.bool; 21 + }; 22 + }; 23 + 24 + config = mkIf cfg.enable { 25 + programs.tmux = { 26 + enable = true; 27 + aggressiveResize = true; 28 + baseIndex = 1; 29 + escapeTime = 0; 30 + historyLimit = 5000; 31 + keyMode = "vi"; 32 + shortcut = "a"; 33 + terminal = "xterm-256color"; 34 + sensibleOnTop = false; 35 + 36 + secureSocket = stdenv.hostPlatform.isLinux; 37 + 38 + plugins = [ ]; 39 + 40 + extraConfig = '' 41 + set -g mouse on 42 + set -g set-clipboard on 43 + 44 + set-option -g focus-events on 45 + 46 + set -g status-left-length 32 47 + set -g status-right-length 150 48 + set -g status-interval 5 49 + 50 + set-option -ga terminal-overrides ",xterm-256color*:Tc:smso" 51 + 52 + set-option -g status-style fg="${defaultActiveColor}",bg=default 53 + 54 + set-window-option -g window-status-style fg="${defaultInactiveColor}",bg=default 55 + set-window-option -g aggressive-resize on 56 + set-window-option -g window-status-current-style fg="${defaultActiveColor}",bg=default 57 + set-window-option -g window-status-current-format "#[bold]#I #W" 58 + set-option -g pane-border-style fg="${defaultInactiveColor}" 59 + set-option -g pane-active-border-style fg="${defaultBorderColor}" 60 + set-option -g message-style fg="${defaultActiveColor}",bg=default 61 + set-option -g display-panes-active-colour "${defaultActiveColor}" 62 + set-option -g display-panes-colour "${defaultInactiveColor}" 63 + set-window-option -g clock-mode-colour "${defaultActiveColor}" 64 + 65 + set -g window-status-format "#I #W" 66 + 67 + set -g status-left "#[fg=${defaultFeatureColor},bold]#S " 68 + set -g status-right "#[fg=${defaultInactiveColor}] %R %d %b" 69 + 70 + set -g pane-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}" 71 + set -g pane-active-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}" 72 + 73 + unbind C-p 74 + bind C-p paste-buffer 75 + 76 + bind -n C-h select-pane -L 77 + bind -n C-j select-pane -D 78 + bind -n C-k select-pane -U 79 + bind -n C-l select-pane -R 80 + 81 + bind -r h resize-pane -L 2 82 + bind -r j resize-pane -D 2 83 + bind -r k resize-pane -U 2 84 + bind -r l resize-pane -R 2 85 + 86 + bind b kill-pane 87 + ''; 88 + }; 89 + 90 + programs.zsh.shellAliases = mkIf config.modules.shell.enable { 91 + ta = "tmux attach -t"; 92 + ts = "tmux new-session -s"; 93 + tl = "tmux list-sessions"; 94 + tksv = "tmux kill-server"; 95 + tkss = "tmux kill-session -t"; 96 + }; 97 + }; 98 + }
+3 -5
home/default.nix
··· 3 3 { 4 4 imports = [ 5 5 ./base 6 - ./git.nix 7 - ./zsh.nix 8 - ./tmux.nix 9 - ./gpg 10 - ./js 6 + ./development 7 + ./desktop 8 + ./apps 11 9 ]; 12 10 }
+15 -2
home/desktop/default.nix
··· 1 - { ... }: 1 + { lib, helpers, ... }: 2 + 3 + with lib; { 4 + options.modules.desktop = { 5 + enable = mkOption { 6 + default = false; 7 + example = true; 8 + description = "Whether to enable Desktop options."; 9 + type = types.bool; 10 + }; 11 + }; 2 12 3 - { 13 + config.modules.desktop = { 14 + enable = if helpers.isLinux then (mkDefault false) else (mkForce false); 15 + }; 16 + } // helpers.linuxAttrs { 4 17 imports = [ 5 18 ./theme.nix 6 19 ];
+33 -19
home/desktop/theme.nix
··· 1 - { pkgs, ... } @ inputs: 1 + { lib, config, pkgs, ... }: 2 2 3 - { 4 - fonts.fontconfig.enable = true; 5 - 6 - services.xsettingsd = { 7 - enable = true; 8 - settings = { 9 - "Gtk/CursorThemeName" = "Bibata-Modern-Classic"; 10 - "Xft/Antialias" = true; 11 - "Xft/Hinting" = true; 12 - "Xft/HintStyle" = "hintslight"; 13 - "Xft/RGBA" = "rgb"; 14 - "Xft/dpi" = 163; 3 + with lib; 4 + let 5 + cfg = config.modules.desktop; 6 + in { 7 + options.modules.desktop.theme = { 8 + enable = mkOption { 9 + default = cfg.enable; 10 + example = true; 11 + description = "Whether to enable default theme."; 12 + type = types.bool; 15 13 }; 16 14 }; 17 15 18 - home.pointerCursor = { 19 - name = "Bibata-Modern-Classic"; 20 - package = pkgs.bibata-cursors; 21 - size = 24; 22 - gtk.enable = true; 23 - x11.enable = true; 16 + config = mkIf cfg.theme.enable { 17 + fonts.fontconfig.enable = true; 18 + 19 + services.xsettingsd = { 20 + enable = true; 21 + settings = { 22 + "Gtk/CursorThemeName" = "Bibata-Modern-Classic"; 23 + "Xft/Antialias" = true; 24 + "Xft/Hinting" = true; 25 + "Xft/HintStyle" = "hintslight"; 26 + "Xft/RGBA" = "rgb"; 27 + "Xft/dpi" = 163; 28 + }; 29 + }; 30 + 31 + home.pointerCursor = { 32 + name = "Bibata-Modern-Classic"; 33 + package = pkgs.bibata-cursors; 34 + size = 24; 35 + gtk.enable = true; 36 + x11.enable = true; 37 + }; 24 38 }; 25 39 }
+16
home/development/default.nix
··· 1 + { lib, ... }: 2 + 3 + with lib; { 4 + options.modules.development = { 5 + enable = mkOption { 6 + default = false; 7 + example = true; 8 + description = "Whether to enable Development options."; 9 + type = types.bool; 10 + }; 11 + }; 12 + 13 + imports = [ 14 + ./js.nix 15 + ]; 16 + }
+40
home/development/js.nix
··· 1 + { lib, config, ... }: 2 + 3 + with lib; 4 + let 5 + cfg = config.modules.development; 6 + home = config.home.homeDirectory; 7 + in { 8 + options.modules.development.js = { 9 + enable = mkOption { 10 + default = cfg.enable; 11 + example = true; 12 + description = "Whether to enable JS configuration."; 13 + type = types.bool; 14 + }; 15 + }; 16 + 17 + config = mkIf cfg.js.enable { 18 + age.secrets."npmrc" = { 19 + symlink = true; 20 + path = "${home}/.npmrc"; 21 + file = ./encrypt/npmrc.age; 22 + }; 23 + 24 + home.file.".yarnrc".text = '' 25 + disable-self-update-check true 26 + ''; 27 + 28 + home.file.".bunfig.toml".text = '' 29 + telemetry = false 30 + 31 + [install] 32 + auto = "disable" 33 + globalDir = "~/.local/share/bun/global" 34 + globalBinDir = "~/.local/share/bun" 35 + 36 + [install.cache] 37 + dir = "~/.cache/bun/install/cache" 38 + ''; 39 + }; 40 + }
-115
home/git.nix
··· 1 - { pkgs, lib, config, ... } @ inputs: 2 - 3 - { 4 - home.packages = [ 5 - pkgs.git-crypt 6 - pkgs.git-get 7 - ]; 8 - 9 - programs.git = { 10 - enable = true; 11 - userName = "Phil Pluckthun"; 12 - userEmail = "phil@kitten.sh"; 13 - 14 - signing = { 15 - signByDefault = true; 16 - key = "303B6A9A312AA035"; 17 - }; 18 - 19 - ignores = [ 20 - ".DS_Store" 21 - "*.sw[nop]" 22 - "*.undodir" 23 - ".env" 24 - "*.orig" 25 - ]; 26 - 27 - lfs = { 28 - enable = true; 29 - }; 30 - 31 - aliases = { 32 - s = "status -s"; 33 - last = "log -1"; 34 - lol = "log --pretty=longline"; 35 - recommit = "commit -a --amend --no-edit"; 36 - pushf = "push --force-with-lease"; 37 - glog = "log --pretty=longline --decorate --all --graph --date=relative"; 38 - journal = "!f() { git commit -a -m \"$(date +'%Y-%m-%d %H:%M:%S')\"; }; f"; 39 - }; 40 - 41 - extraConfig = { 42 - commit.gpgSign = true; 43 - tag.gpgSign = true; 44 - push.gpgSign = "if-asked"; 45 - 46 - color.ui = "auto"; 47 - init.defaultBranch = "main"; 48 - 49 - branch.sort = "-committerdate"; 50 - tag.sort = "-taggerdate"; 51 - 52 - status = { 53 - showUntrackedFiles = "all"; 54 - submoduleSummary = true; 55 - }; 56 - 57 - diff = { 58 - tool = "vimdiff"; 59 - submodule = "log"; 60 - algorithm = "histogram"; 61 - colorMovedWS = "allow-indentation-change"; 62 - compactionHeuristic = true; 63 - context = 10; 64 - }; 65 - 66 - push = { 67 - default = "simple"; 68 - autoSetupRemote = true; 69 - followtags = true; 70 - }; 71 - 72 - rebase = { 73 - autosquash = true; 74 - autostash = true; 75 - updateRefs = true; 76 - missingCommitsCheck = "error"; 77 - }; 78 - 79 - merge = { 80 - ff = "only"; 81 - tool = "vimdiff"; 82 - keepbackup = false; 83 - }; 84 - 85 - fetch = { 86 - prune = true; 87 - prunetags = true; 88 - }; 89 - 90 - gitget = { 91 - root = "${config.home.homeDirectory}/git"; 92 - host = "github.com"; 93 - skip-host = true; 94 - }; 95 - 96 - core.autocrlf = false; 97 - pull.rebase = true; 98 - rerere.enabled = true; 99 - difftool.prompt = false; 100 - mergetool.prompt = true; 101 - transfer.fsckobjects = true; 102 - fetch.fsckobjects = true; 103 - receive.fsckObjects = true; 104 - submodule.recurse = true; 105 - 106 - "mergetool \"vimdiff\"".cmd = "nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"; 107 - pretty.longline = "tformat:%Cgreen%h %Cred%D %Creset%s %Cblue(%cd, by %an)"; 108 - 109 - "remote \"origin\"" = { 110 - fetch = "+refs/pull/*/head:refs/remotes/origin/pr/*"; 111 - pruneTags = true; 112 - }; 113 - }; 114 - }; 115 - }
-32
home/gpg/default.nix
··· 1 - { config, pkgs, ... } @ inputs: 2 - 3 - { 4 - age.secrets."pubring.kbx" = { 5 - symlink = true; 6 - path = "${config.home.homeDirectory}/.gnupg/pubring.kbx"; 7 - file = ./encrypt/pubring.kbx.age; 8 - }; 9 - 10 - age.secrets."75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key" = { 11 - symlink = true; 12 - path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key"; 13 - file = ./encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age; 14 - }; 15 - 16 - age.secrets."E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key" = { 17 - symlink = true; 18 - path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key"; 19 - file = ./encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age; 20 - }; 21 - 22 - age.secrets."CA84692E3CC846C8EC7272468E962B63FC599E49.key" = { 23 - symlink = true; 24 - path = "${config.home.homeDirectory}/.gnupg/private-keys-v1.d/CA84692E3CC846C8EC7272468E962B63FC599E49.key"; 25 - file = ./encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age; 26 - }; 27 - 28 - home.file.".gnupg/sshcontrol".text = '' 29 - E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6 30 - 75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7 31 - ''; 32 - }
home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age home/base/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age
home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age home/base/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age
home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age home/base/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age
home/gpg/encrypt/pubring.kbx.age home/base/encrypt/pubring.kbx.age
-27
home/js/default.nix
··· 1 - { config, ... } @ inputs: 2 - 3 - { 4 - age.secrets."npmrc" = { 5 - symlink = true; 6 - path = "${config.home.homeDirectory}/.npmrc"; 7 - file = ./encrypt/npmrc.age; 8 - }; 9 - 10 - home.file.".yarnrc".text = '' 11 - disable-self-update-check true 12 - email phil@kitten.sh 13 - username philpl 14 - ''; 15 - 16 - home.file.".bunfig.toml".text = '' 17 - telemetry = false 18 - 19 - [install] 20 - auto = "disable" 21 - globalDir = "~/.local/share/bun/global" 22 - globalBinDir = "~/.local/share/bun" 23 - 24 - [install.cache] 25 - dir = "~/.cache/bun/install/cache" 26 - ''; 27 - }
home/js/encrypt/npmrc.age home/development/encrypt/npmrc.age
-85
home/tmux.nix
··· 1 - { lib, pkgs, ... } @ inputs: 2 - 3 - let 4 - inherit (pkgs) stdenv; 5 - inherit (import ../lib/colors.nix inputs) colors; 6 - 7 - defaultActiveColor = colors.yellow.gui; 8 - defaultInactiveColor = colors.muted.gui; 9 - defaultFeatureColor = colors.blue.gui; 10 - defaultBorderColor = colors.green.gui; 11 - defaultSplitColor = colors.split.gui; 12 - in { 13 - programs.tmux = { 14 - enable = true; 15 - aggressiveResize = true; 16 - baseIndex = 1; 17 - escapeTime = 0; 18 - historyLimit = 5000; 19 - keyMode = "vi"; 20 - shortcut = "a"; 21 - terminal = "xterm-256color"; 22 - sensibleOnTop = false; 23 - 24 - secureSocket = stdenv.hostPlatform.isLinux; 25 - 26 - plugins = [ ]; 27 - 28 - extraConfig = '' 29 - set -g mouse on 30 - set -g set-clipboard on 31 - 32 - set-option -g focus-events on 33 - 34 - set -g status-left-length 32 35 - set -g status-right-length 150 36 - set -g status-interval 5 37 - 38 - set-option -ga terminal-overrides ",xterm-256color*:Tc:smso" 39 - 40 - set-option -g status-style fg="${defaultActiveColor}",bg=default 41 - 42 - set-window-option -g window-status-style fg="${defaultInactiveColor}",bg=default 43 - set-window-option -g aggressive-resize on 44 - set-window-option -g window-status-current-style fg="${defaultActiveColor}",bg=default 45 - set-window-option -g window-status-current-format "#[bold]#I #W" 46 - set-option -g pane-border-style fg="${defaultInactiveColor}" 47 - set-option -g pane-active-border-style fg="${defaultBorderColor}" 48 - set-option -g message-style fg="${defaultActiveColor}",bg=default 49 - set-option -g display-panes-active-colour "${defaultActiveColor}" 50 - set-option -g display-panes-colour "${defaultInactiveColor}" 51 - set-window-option -g clock-mode-colour "${defaultActiveColor}" 52 - 53 - set -g window-status-format "#I #W" 54 - 55 - set -g status-left "#[fg=${defaultFeatureColor},bold]#S " 56 - set -g status-right "#[fg=${defaultInactiveColor}] %R %d %b" 57 - 58 - set -g pane-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}" 59 - set -g pane-active-border-style fg="${defaultSplitColor}",bg="${defaultSplitColor}" 60 - 61 - unbind C-p 62 - bind C-p paste-buffer 63 - 64 - bind -n C-h select-pane -L 65 - bind -n C-j select-pane -D 66 - bind -n C-k select-pane -U 67 - bind -n C-l select-pane -R 68 - 69 - bind -r h resize-pane -L 2 70 - bind -r j resize-pane -D 2 71 - bind -r k resize-pane -U 2 72 - bind -r l resize-pane -R 2 73 - 74 - bind b kill-pane 75 - ''; 76 - }; 77 - 78 - programs.zsh.shellAliases = { 79 - ta = "tmux attach -t"; 80 - ts = "tmux new-session -s"; 81 - tl = "tmux list-sessions"; 82 - tksv = "tmux kill-server"; 83 - tkss = "tmux kill-session -t"; 84 - }; 85 - }
-87
home/zsh.nix
··· 1 - { pkgs, lib, ... }: 2 - 3 - { 4 - programs.zsh = { 5 - enable = true; 6 - enableAutosuggestions = true; 7 - 8 - enableCompletion = false; 9 - 10 - shellAliases = { 11 - ls = "ls --color=auto"; 12 - ll = "ls -l"; 13 - wx = "wezmux"; 14 - http = "xh"; 15 - }; 16 - 17 - initExtra = '' 18 - function update_title_preexec { 19 - emulate -L zsh 20 - setopt extended_glob 21 - local title=''${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%} 22 - printf "\e]0;%s\e\\" "$title" 23 - } 24 - function update_title_precmd { 25 - emulate -L zsh 26 - setopt extended_glob 27 - local title=''${PWD##*/} 28 - printf "\e]0;%s\e\\" "$title" 29 - } 30 - 31 - add-zsh-hook preexec update_title_preexec 32 - add-zsh-hook precmd update_title_precmd 33 - ''; 34 - 35 - plugins = [ 36 - { 37 - name = "zsh-syntax-highlighting"; 38 - src = pkgs.fetchFromGitHub { 39 - owner = "zsh-users"; 40 - repo = "zsh-syntax-highlighting"; 41 - rev = "91d2eeaf23c47341e8dc7ad66dbf85e38c2674de"; 42 - sha256 = "1160bbhpd2p6qlw1b5k86z243iv0yhv6x7pf414sr8q4cm59x2h0"; 43 - }; 44 - } 45 - ]; 46 - }; 47 - 48 - programs.direnv = { 49 - enable = true; 50 - enableZshIntegration = true; 51 - nix-direnv.enable = true; 52 - }; 53 - 54 - programs.zoxide = { 55 - enable = true; 56 - enableZshIntegration = true; 57 - enableNushellIntegration = lib.mkDefault false; 58 - enableFishIntegration = lib.mkDefault false; 59 - }; 60 - 61 - programs.starship = { 62 - enable = true; 63 - enableZshIntegration = true; 64 - 65 - settings = { 66 - add_newline = false; 67 - gcloud.disabled = true; 68 - aws.disabled = true; 69 - cmd_duration.disabled = true; 70 - battery.disabled = true; 71 - nodejs.disabled = true; 72 - deno.disabled = true; 73 - character.success_symbol = "[➜](green)"; 74 - character.error_symbol = "[➜](bold red)"; 75 - git_branch.symbol = " "; 76 - git_commit.tag_symbol = " "; 77 - git_status.format = "([$all_status]($style))"; 78 - git_status.conflicted = " "; 79 - git_status.untracked = " "; 80 - git_status.modified = " "; 81 - git_status.staged = " "; 82 - git_status.deleted = " "; 83 - git_status.renamed = " "; 84 - git_status.stashed = " "; 85 - }; 86 - }; 87 - }
+10 -3
machines/fanta/home.nix
··· 1 1 { ... }: 2 2 3 3 { 4 - imports = [ 5 - ../../home/apps 6 - ]; 4 + modules = { 5 + development.enable = true; 6 + apps = { 7 + enable = true; 8 + wezterm.enable = true; 9 + firefox.enable = true; 10 + obsidian.enable = true; 11 + ollama.enable = true; 12 + }; 13 + }; 7 14 }
+11 -4
machines/pepper/home.nix
··· 1 1 { ... }: 2 2 3 3 { 4 - imports = [ 5 - ../../home/desktop 6 - ../../home/apps 7 - ]; 4 + modules = { 5 + development.enable = true; 6 + desktop.enable = true; 7 + apps = { 8 + enable = true; 9 + wezterm.enable = true; 10 + firefox.enable = true; 11 + obsidian.enable = true; 12 + ollama.enable = true; 13 + }; 14 + }; 8 15 }
+10 -3
machines/sprite/home.nix
··· 1 1 { ... }: 2 2 3 3 { 4 - imports = [ 5 - ../../home/apps 6 - ]; 4 + modules = { 5 + development.enable = true; 6 + apps = { 7 + enable = true; 8 + wezterm.enable = true; 9 + firefox.enable = true; 10 + obsidian.enable = true; 11 + ollama.enable = true; 12 + }; 13 + }; 7 14 }
+5 -5
secrets.nix
··· 15 15 "./modules/server/encrypt/tailscale.age".publicKeys = keys; 16 16 "./modules/server/encrypt/rclone.conf.age".publicKeys = keys; 17 17 18 - "./home/gpg/encrypt/pubring.kbx.age".publicKeys = keys; 19 - "./home/gpg/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age".publicKeys = keys; 20 - "./home/gpg/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age".publicKeys = keys; 21 - "./home/gpg/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age".publicKeys = keys; 18 + "./home/base/encrypt/pubring.kbx.age".publicKeys = keys; 19 + "./home/base/encrypt/75EF1DBB30A59CFB56BCE06A88CCF363DA63B1A7.key.age".publicKeys = keys; 20 + "./home/base/encrypt/E2BFF19637FDC25A02F45583176FAD1ED1F6BDD6.key.age".publicKeys = keys; 21 + "./home/base/encrypt/CA84692E3CC846C8EC7272468E962B63FC599E49.key.age".publicKeys = keys; 22 22 23 - "./home/js/encrypt/npmrc.age".publicKeys = keys; 23 + "./home/development/encrypt/npmrc.age".publicKeys = keys; 24 24 }