diff --git a/darwin/home.nix b/darwin/home.nix index 7b4e90fa..6dac3f3b 100644 --- a/darwin/home.nix +++ b/darwin/home.nix @@ -1,4 +1,8 @@ -{config,lib,...}: let +{ + config, + lib, + ... +}: let inherit (lib.modules) mkForce mkMerge; in { services.gpg-agent = { diff --git a/kat/default.nix b/kat/default.nix index 642365c5..908cc39b 100644 --- a/kat/default.nix +++ b/kat/default.nix @@ -1,7 +1,12 @@ -{tree,lib,...}: let +{ + tree, + lib, + ... +}: let inherit (lib.attrsets) mapAttrs; - wrapImports = imports: mapAttrs - (_: paths: { config, ... }: { + wrapImports = imports: + mapAttrs + (_: paths: {config, ...}: { config.home-manager.users.kat = { imports = lib.singleton paths; }; @@ -9,19 +14,19 @@ imports; dirImports = wrapImports tree.prev; in -tree.prev -// { - common = { - imports = with tree.prev; [ - base16 - shell - neovim - ]; - }; - work = { - imports = with dirImports; [ - wezterm - gpg - ]; - }; -} + tree.prev + // { + common = { + imports = with tree.prev; [ + base16 + shell + neovim + ]; + }; + work = { + imports = with dirImports; [ + wezterm + gpg + ]; + }; + } diff --git a/kat/shell/bitw.nix b/kat/shell/bitw.nix index 5fe224e6..e5b32b86 100644 --- a/kat/shell/bitw.nix +++ b/kat/shell/bitw.nix @@ -1,4 +1,8 @@ -{pkgs,tree,...}: { +{ + pkgs, + tree, + ... +}: { programs.rbw = { enable = true; package = pkgs.rbw-bitw; diff --git a/kat/shell/git.nix b/kat/shell/git.nix index f1ac6924..03e67e97 100644 --- a/kat/shell/git.nix +++ b/kat/shell/git.nix @@ -1,4 +1,8 @@ -{pkgs,tree,...}: let +{ + pkgs, + tree, + ... +}: let kat = import tree.kat.user.data; in { home.packages = with pkgs; [ diff --git a/kat/shell/zsh.nix b/kat/shell/zsh.nix index 4b832a81..3cd911a3 100644 --- a/kat/shell/zsh.nix +++ b/kat/shell/zsh.nix @@ -1,11 +1,11 @@ { config, - lib, - pkgs, - ... + lib, + pkgs, + ... }: { home.packages = with pkgs; [ -# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions + # programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions zsh-completions ]; @@ -20,7 +20,7 @@ enableAutosuggestions = true; initExtra = let zshOpts = [ - "auto_pushd" + "auto_pushd" "pushd_ignore_dups" "pushdminus" "rmstarsilent" @@ -40,71 +40,71 @@ "nolistbeep" "autolist" "listrowsfirst" - ]; + ]; in '' - ${ + ${ if pkgs.hostPlatform.isLinux - then '' - eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90") - '' + then '' + eval $(dircolors -b | sd "\*#=00;90" "*\#=00;90") + '' else '' - '' + '' } - PROMPT_EOL_MARK=''' - ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm' - ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true - zmodload -i zsh/complist - h=() - if [[ -r ~/.ssh/config ]]; then - h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) - fi - if [[ $#h -gt 0 ]]; then - zstyle ':completion:*:ssh:*' hosts $h - zstyle ':completion:*:slogin:*' hosts $h - fi - unset h - u=(root ${config.home.username}) - zstyle ':completion:*:ssh:*' users $u - unset u - zstyle ':completion:*:*:*:*:*' menu select - zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories - zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' - zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" - zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*' - zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} - zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath' - ${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)} - bindkey '^ ' autosuggest-accept - ${ + PROMPT_EOL_MARK=''' + ZSH_TAB_TITLE_ADDITIONAL_TERMS='wezterm' + ZSH_TAB_TITLE_ENABLE_FULL_COMMAND=true + zmodload -i zsh/complist + h=() + if [[ -r ~/.ssh/config ]]; then + h=($h ''${''${''${(@M)''${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) + fi + if [[ $#h -gt 0 ]]; then + zstyle ':completion:*:ssh:*' hosts $h + zstyle ':completion:*:slogin:*' hosts $h + fi + unset h + u=(root ${config.home.username}) + zstyle ':completion:*:ssh:*' users $u + unset u + zstyle ':completion:*:*:*:*:*' menu select + zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories + zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' + zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" + zstyle ':completion:*:complete:pass:*:*' matcher 'r:|[./_-]=** r:|=*' 'l:|=* r:|=*' + zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1lb --color=always $realpath' + ${lib.concatStringsSep "\n" (map (opt: "setopt ${opt}") zshOpts)} + bindkey '^ ' autosuggest-accept + ${ if pkgs.hostPlatform.isDarwin - then '' - export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH" - '' + then '' + export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH" + '' else "" } ''; shellAliases = lib.mkMerge [ - { - nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; - dmesg = "dmesg -HP"; - hg = "history 0 | rg"; - } - (lib.mkIf pkgs.hostPlatform.isLinux { - sys = "systemctl"; - sysu = "systemctl --user"; - logu = "journalctl --user"; - log = "journalctl"; - lg = "log --no-pager | rg"; - }) + { + nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; + dmesg = "dmesg -HP"; + hg = "history 0 | rg"; + } + (lib.mkIf pkgs.hostPlatform.isLinux { + sys = "systemctl"; + sysu = "systemctl --user"; + logu = "journalctl --user"; + log = "journalctl"; + lg = "log --no-pager | rg"; + }) ]; localVariables = { ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold"; ZSH_AUTOSUGGEST_USE_ASYNC = 1; }; plugins = with pkgs.zsh-plugins; (map (plugin: plugin.zshPlugin) [ - tab-title - vim-mode - evil-registers + tab-title + vim-mode + evil-registers ]); }; diff --git a/kat/user/common.nix b/kat/user/common.nix index 38428092..8dc6b0d7 100644 --- a/kat/user/common.nix +++ b/kat/user/common.nix @@ -1,4 +1,8 @@ -{pkgs,tree,...}: { +{ + pkgs, + tree, + ... +}: { users.users.kat = { inherit (import tree.kat.user.data) description; shell = pkgs.zsh; diff --git a/kat/user/data.nix b/kat/user/data.nix index c425d4e8..d4c1b122 100644 --- a/kat/user/data.nix +++ b/kat/user/data.nix @@ -1,7 +1,7 @@ rec { description = "Kat Inskip"; email = "kat@inskip.me"; - keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPsu3vNsvBb/G+wALpstD/DnoRZ3fipAs00jtl8rzDuv96RlS7AJr4aNvG6Pt2D9SYn2wVLaiw+76mz2gOycH9/N+VCvL4/0MN9uqj+7XIcxNRo0gHVOblmi2bOXcmGKh3eRwHj1xyDwRxo9WIuBEP2bPpDPz75OXRtEdlTgvky7siSguQxJu03cb0p9hNAYhUoohNXyWW2CjDCLUQVE1+QRVUzsKq3KkPy0cHYgmZC1gRSMQyKpMt72L5tayLz3Tp/zrshucc+QO5IJeZdqMxsNAcvALsysT1J5EqxZoYH9VpWLRhSgVD6Nvn853pycJAlXQxgOCpSD3/v/JbgUe5NE+ci0o7NMy5IiHUv2gQMRIEhwBHlRGwokUPL9upx0lsjaEiPya5xQqqDKRom87xytM778ANS5CuMdQMWg9qVbpHZUHMjA0QmNkjPgq71pUDXHk5L4mZuS8wVjyjnvlw68yIJuHEc8P7QiLcjvRHFS2L9Ck8NRmPDTQXlQi9kk6LmMyu6fdevR/kZL21b+xO1e2DMyxBbNDTot8luppiiL8adgUDMwptpIne7JCWB1o9NFCbXUVgwuCCYBif6pOGSc6bGo1JTAKMflRlcy6Mi3t5H0mR2lj/sCSTWwTlP5FM4aPIq08NvW6PeuK1bFJY9fIgTwVsUnbAKOhmsMt62w== pgp-${email}" ]; + keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPsu3vNsvBb/G+wALpstD/DnoRZ3fipAs00jtl8rzDuv96RlS7AJr4aNvG6Pt2D9SYn2wVLaiw+76mz2gOycH9/N+VCvL4/0MN9uqj+7XIcxNRo0gHVOblmi2bOXcmGKh3eRwHj1xyDwRxo9WIuBEP2bPpDPz75OXRtEdlTgvky7siSguQxJu03cb0p9hNAYhUoohNXyWW2CjDCLUQVE1+QRVUzsKq3KkPy0cHYgmZC1gRSMQyKpMt72L5tayLz3Tp/zrshucc+QO5IJeZdqMxsNAcvALsysT1J5EqxZoYH9VpWLRhSgVD6Nvn853pycJAlXQxgOCpSD3/v/JbgUe5NE+ci0o7NMy5IiHUv2gQMRIEhwBHlRGwokUPL9upx0lsjaEiPya5xQqqDKRom87xytM778ANS5CuMdQMWg9qVbpHZUHMjA0QmNkjPgq71pUDXHk5L4mZuS8wVjyjnvlw68yIJuHEc8P7QiLcjvRHFS2L9Ck8NRmPDTQXlQi9kk6LmMyu6fdevR/kZL21b+xO1e2DMyxBbNDTot8luppiiL8adgUDMwptpIne7JCWB1o9NFCbXUVgwuCCYBif6pOGSc6bGo1JTAKMflRlcy6Mi3t5H0mR2lj/sCSTWwTlP5FM4aPIq08NvW6PeuK1bFJY9fIgTwVsUnbAKOhmsMt62w== pgp-${email}"]; keyid = "9CC644B569CDA59BC874C4C9E8DDE3ED1C90F3A0"; keygrip = "59921D2F4E6DF7EEC3CB2934BD3D53666007B1AB"; userName = description; diff --git a/kat/user/nixos.nix b/kat/user/nixos.nix index 344839f9..e7be250f 100644 --- a/kat/user/nixos.nix +++ b/kat/user/nixos.nix @@ -1,4 +1,4 @@ -{tree,...}: { +{tree, ...}: { users.users.kat = { uid = 1000; isNormalUser = true;