From 1ec876812ed1a84e851a82bc81efd91e7b7a65f9 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Tue, 17 Jan 2023 15:32:14 -0500 Subject: [PATCH] mixed: gpg fixes, refactoring --- {system => common}/home.nix | 8 +- {system => common}/nix.nix | 0 {system => common}/overlay.nix | 0 darwin/{base => common}/docs.nix | 0 darwin/{base => common}/fonts.nix | 0 darwin/{base => common}/gpg.nix | 0 darwin/{base => common}/homebrew.nix | 0 darwin/{base => common}/nix.nix | 0 darwin/{base => common}/shell.nix | 0 darwin/{base => common}/system.nix | 0 darwin/home.nix | 16 ++- darwin/kat.nix | 14 --- home/shell/zsh.nix | 114 ------------------- {home => kat}/base16.nix | 0 kat/default.nix | 27 +++++ {home => kat}/gpg.nix | 9 +- {home => kat}/neovim/default.nix | 0 {home => kat}/neovim/init.lua | 0 {home => kat}/shell/bitw.nix | 4 +- {home => kat}/shell/direnv.nix | 0 {home => kat}/shell/exa.nix | 0 {home => kat}/shell/fzf.nix | 0 {home => kat}/shell/git.nix | 9 +- {home => kat}/shell/inputrc.nix | 0 {home => kat}/shell/lc.nix | 0 {home => kat}/shell/packages.nix | 0 {home => kat}/shell/rink.nix | 0 {home => kat}/shell/ssh.nix | 0 {home => kat}/shell/starship.nix | 0 {home => kat}/shell/tmux.nix | 0 {home => kat}/shell/z.nix | 0 kat/shell/zsh.nix | 114 +++++++++++++++++++ {home => kat}/state.nix | 0 kat/user/common.nix | 6 + kat/user/darwin.nix | 10 ++ kat/user/data.nix | 10 ++ {home => kat/user}/default.nix | 13 +-- kat/user/nixos.nix | 17 +++ {home => kat}/wezterm.nix | 0 {darwin/modules => modules/darwin}/blank.nix | 0 {home/modules => modules/home}/blank.nix | 0 {home/modules => modules/home}/disable.nix | 0 {home/modules => modules/home}/neovim.nix | 0 modules/home/zsh.nix | 5 + {nixos/modules => modules/nixos}/blank.nix | 0 nixos/{base.nix => common.nix} | 0 nixos/users/kat.nix | 20 ---- systems/default.nix | 6 +- systems/sumireko.nix | 3 +- tree.nix | 13 ++- 50 files changed, 235 insertions(+), 183 deletions(-) rename {system => common}/home.nix (80%) rename {system => common}/nix.nix (100%) rename {system => common}/overlay.nix (100%) rename darwin/{base => common}/docs.nix (100%) rename darwin/{base => common}/fonts.nix (100%) rename darwin/{base => common}/gpg.nix (100%) rename darwin/{base => common}/homebrew.nix (100%) rename darwin/{base => common}/nix.nix (100%) rename darwin/{base => common}/shell.nix (100%) rename darwin/{base => common}/system.nix (100%) delete mode 100644 darwin/kat.nix delete mode 100644 home/shell/zsh.nix rename {home => kat}/base16.nix (100%) create mode 100644 kat/default.nix rename {home => kat}/gpg.nix (64%) rename {home => kat}/neovim/default.nix (100%) rename {home => kat}/neovim/init.lua (100%) rename {home => kat}/shell/bitw.nix (74%) rename {home => kat}/shell/direnv.nix (100%) rename {home => kat}/shell/exa.nix (100%) rename {home => kat}/shell/fzf.nix (100%) rename {home => kat}/shell/git.nix (78%) rename {home => kat}/shell/inputrc.nix (100%) rename {home => kat}/shell/lc.nix (100%) rename {home => kat}/shell/packages.nix (100%) rename {home => kat}/shell/rink.nix (100%) rename {home => kat}/shell/ssh.nix (100%) rename {home => kat}/shell/starship.nix (100%) rename {home => kat}/shell/tmux.nix (100%) rename {home => kat}/shell/z.nix (100%) create mode 100644 kat/shell/zsh.nix rename {home => kat}/state.nix (100%) create mode 100644 kat/user/common.nix create mode 100644 kat/user/darwin.nix create mode 100644 kat/user/data.nix rename {home => kat/user}/default.nix (58%) create mode 100644 kat/user/nixos.nix rename {home => kat}/wezterm.nix (100%) rename {darwin/modules => modules/darwin}/blank.nix (100%) rename {home/modules => modules/home}/blank.nix (100%) rename {home/modules => modules/home}/disable.nix (100%) rename {home/modules => modules/home}/neovim.nix (100%) create mode 100644 modules/home/zsh.nix rename {nixos/modules => modules/nixos}/blank.nix (100%) rename nixos/{base.nix => common.nix} (100%) delete mode 100644 nixos/users/kat.nix diff --git a/system/home.nix b/common/home.nix similarity index 80% rename from system/home.nix rename to common/home.nix index 82f6dfca..1c1e2384 100644 --- a/system/home.nix +++ b/common/home.nix @@ -13,13 +13,13 @@ in { useUserPackages = true; sharedModules = with tree; [ - home.modules - home.state + modules.home + kat.state ] ++ optional (tree.${systemType} ? home) tree.${systemType}.home; - users.kat.imports = with tree; [ - home.base + users.kat.imports = with tree.kat; [ + common ]; extraSpecialArgs = { inherit tree machine; diff --git a/system/nix.nix b/common/nix.nix similarity index 100% rename from system/nix.nix rename to common/nix.nix diff --git a/system/overlay.nix b/common/overlay.nix similarity index 100% rename from system/overlay.nix rename to common/overlay.nix diff --git a/darwin/base/docs.nix b/darwin/common/docs.nix similarity index 100% rename from darwin/base/docs.nix rename to darwin/common/docs.nix diff --git a/darwin/base/fonts.nix b/darwin/common/fonts.nix similarity index 100% rename from darwin/base/fonts.nix rename to darwin/common/fonts.nix diff --git a/darwin/base/gpg.nix b/darwin/common/gpg.nix similarity index 100% rename from darwin/base/gpg.nix rename to darwin/common/gpg.nix diff --git a/darwin/base/homebrew.nix b/darwin/common/homebrew.nix similarity index 100% rename from darwin/base/homebrew.nix rename to darwin/common/homebrew.nix diff --git a/darwin/base/nix.nix b/darwin/common/nix.nix similarity index 100% rename from darwin/base/nix.nix rename to darwin/common/nix.nix diff --git a/darwin/base/shell.nix b/darwin/common/shell.nix similarity index 100% rename from darwin/base/shell.nix rename to darwin/common/shell.nix diff --git a/darwin/base/system.nix b/darwin/common/system.nix similarity index 100% rename from darwin/base/system.nix rename to darwin/common/system.nix diff --git a/darwin/home.nix b/darwin/home.nix index eccbafee..7b4e90fa 100644 --- a/darwin/home.nix +++ b/darwin/home.nix @@ -1,7 +1,13 @@ -{config, ...}: { - services.gpg-agent.pinentryFlavor = null; +{config,lib,...}: let + inherit (lib.modules) mkForce mkMerge; +in { + services.gpg-agent = { + enable = mkForce false; + pinentryFlavor = null; + }; - home.file."${config.programs.gpg.homedir}/gpg-agent.conf".text = '' - pinentry-program /opt/homebrew/bin/pinentry-mac - ''; + home.file."${config.programs.gpg.homedir}/gpg-agent.conf".text = mkMerge [ + config.services.gpg-agent.extraConfig + "pinentry-program /opt/homebrew/bin/pinentry-mac" + ]; } diff --git a/darwin/kat.nix b/darwin/kat.nix deleted file mode 100644 index 42f231da..00000000 --- a/darwin/kat.nix +++ /dev/null @@ -1,14 +0,0 @@ -{pkgs, ...}: { - users.users.kat = { - name = "kat"; - home = "/Users/kat"; - shell = pkgs.zsh; - uid = 501; - }; - users.knownUsers = [ - "kat" - ]; - home-manager.users.kat.programs.zsh.initExtraFirst = '' - source /etc/static/zshrc - ''; -} diff --git a/home/shell/zsh.nix b/home/shell/zsh.nix deleted file mode 100644 index d7979631..00000000 --- a/home/shell/zsh.nix +++ /dev/null @@ -1,114 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - home.packages = with pkgs; [ - # programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions - zsh-completions - ]; - - xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec { - default = config.base16.defaultSchemeName; - current = default; - }; - - programs.zsh = { - enable = true; - enableSyntaxHighlighting = true; - enableAutosuggestions = true; - initExtra = let - zshOpts = [ - "auto_pushd" - "pushd_ignore_dups" - "pushdminus" - "rmstarsilent" - "nonomatch" - "long_list_jobs" - "interactivecomments" - "append_history" - "hist_ignore_space" - "hist_verify" - "inc_append_history" - "nosharehistory" - "nomenu_complete" - "auto_menu" - "no_auto_remove_slash" - "complete_in_word" - "always_to_end" - "nolistbeep" - "autolist" - "listrowsfirst" - ]; - in '' - ${ - if pkgs.hostPlatform.isLinux - 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 - ${ - if pkgs.hostPlatform.isDarwin - 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"; - }) - ]; - 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 - ]); - }; - - home.sessionVariables = { - XDG_DATA_HOME = "${config.xdg.dataHome}"; - }; -} diff --git a/home/base16.nix b/kat/base16.nix similarity index 100% rename from home/base16.nix rename to kat/base16.nix diff --git a/kat/default.nix b/kat/default.nix new file mode 100644 index 00000000..642365c5 --- /dev/null +++ b/kat/default.nix @@ -0,0 +1,27 @@ +{tree,lib,...}: let + inherit (lib.attrsets) mapAttrs; + wrapImports = imports: mapAttrs + (_: paths: { config, ... }: { + config.home-manager.users.kat = { + imports = lib.singleton paths; + }; + }) + imports; + dirImports = wrapImports tree.prev; +in +tree.prev +// { + common = { + imports = with tree.prev; [ + base16 + shell + neovim + ]; + }; + work = { + imports = with dirImports; [ + wezterm + gpg + ]; + }; +} diff --git a/home/gpg.nix b/kat/gpg.nix similarity index 64% rename from home/gpg.nix rename to kat/gpg.nix index ff4bf30b..cd501db4 100644 --- a/home/gpg.nix +++ b/kat/gpg.nix @@ -1,10 +1,13 @@ {lib, ...}: let - inherit (lib.modules) mkMerge; + inherit (lib.modules) mkDefault mkMerge; in { services.gpg-agent = { - enable = true; + enable = mkDefault true; enableExtraSocket = true; - enableSshSupport = false; + enableSshSupport = true; + sshKeys = [ + "59921D2F4E6DF7EEC3CB2934BD3D53666007B1AB" # kat@inskip.me + ]; extraConfig = mkMerge [ "auto-expand-secmem 0x30000" # otherwise "gpg: public key decryption failed: Cannot allocate memory" "pinentry-timeout 30" diff --git a/home/neovim/default.nix b/kat/neovim/default.nix similarity index 100% rename from home/neovim/default.nix rename to kat/neovim/default.nix diff --git a/home/neovim/init.lua b/kat/neovim/init.lua similarity index 100% rename from home/neovim/init.lua rename to kat/neovim/init.lua diff --git a/home/shell/bitw.nix b/kat/shell/bitw.nix similarity index 74% rename from home/shell/bitw.nix rename to kat/shell/bitw.nix index 377b2229..5fe224e6 100644 --- a/home/shell/bitw.nix +++ b/kat/shell/bitw.nix @@ -1,9 +1,9 @@ -{pkgs, ...}: { +{pkgs,tree,...}: { programs.rbw = { enable = true; package = pkgs.rbw-bitw; settings = { - email = "kat@kittywit.ch"; + inherit (import tree.kat.user.data) email; base_url = "https://vault.kittywit.ch"; identity_url = null; lock_timeout = 3600; diff --git a/home/shell/direnv.nix b/kat/shell/direnv.nix similarity index 100% rename from home/shell/direnv.nix rename to kat/shell/direnv.nix diff --git a/home/shell/exa.nix b/kat/shell/exa.nix similarity index 100% rename from home/shell/exa.nix rename to kat/shell/exa.nix diff --git a/home/shell/fzf.nix b/kat/shell/fzf.nix similarity index 100% rename from home/shell/fzf.nix rename to kat/shell/fzf.nix diff --git a/home/shell/git.nix b/kat/shell/git.nix similarity index 78% rename from home/shell/git.nix rename to kat/shell/git.nix index 57ea5fa9..f1ac6924 100644 --- a/home/shell/git.nix +++ b/kat/shell/git.nix @@ -1,4 +1,6 @@ -{pkgs, ...}: { +{pkgs,tree,...}: let + kat = import tree.kat.user.data; +in { home.packages = with pkgs; [ gitAndTools.git-remote-gcrypt git-crypt @@ -6,10 +8,9 @@ ]; programs.git = { + inherit (kat) userName userEmail; package = pkgs.gitAndTools.gitFull; enable = true; - userName = "Kat Inskip"; - userEmail = "kat@inskip.me"; extraConfig = { init = {defaultBranch = "main";}; protocol.gcrypt.allow = "always"; @@ -20,7 +21,7 @@ }; }; signing = { - key = "0xE8DDE3ED1C90F3A0"; + inherit (kat) key; signByDefault = true; }; }; diff --git a/home/shell/inputrc.nix b/kat/shell/inputrc.nix similarity index 100% rename from home/shell/inputrc.nix rename to kat/shell/inputrc.nix diff --git a/home/shell/lc.nix b/kat/shell/lc.nix similarity index 100% rename from home/shell/lc.nix rename to kat/shell/lc.nix diff --git a/home/shell/packages.nix b/kat/shell/packages.nix similarity index 100% rename from home/shell/packages.nix rename to kat/shell/packages.nix diff --git a/home/shell/rink.nix b/kat/shell/rink.nix similarity index 100% rename from home/shell/rink.nix rename to kat/shell/rink.nix diff --git a/home/shell/ssh.nix b/kat/shell/ssh.nix similarity index 100% rename from home/shell/ssh.nix rename to kat/shell/ssh.nix diff --git a/home/shell/starship.nix b/kat/shell/starship.nix similarity index 100% rename from home/shell/starship.nix rename to kat/shell/starship.nix diff --git a/home/shell/tmux.nix b/kat/shell/tmux.nix similarity index 100% rename from home/shell/tmux.nix rename to kat/shell/tmux.nix diff --git a/home/shell/z.nix b/kat/shell/z.nix similarity index 100% rename from home/shell/z.nix rename to kat/shell/z.nix diff --git a/kat/shell/zsh.nix b/kat/shell/zsh.nix new file mode 100644 index 00000000..4b832a81 --- /dev/null +++ b/kat/shell/zsh.nix @@ -0,0 +1,114 @@ +{ + config, + lib, + pkgs, + ... +}: { + home.packages = with pkgs; [ +# programs.zsh.enableAutosuggestions only includes nix-zsh-autocompletions + zsh-completions + ]; + + xdg.configFile."kattheme_immutable.json".text = builtins.toJSON rec { + default = config.base16.defaultSchemeName; + current = default; + }; + + programs.zsh = { + enable = true; + enableSyntaxHighlighting = true; + enableAutosuggestions = true; + initExtra = let + zshOpts = [ + "auto_pushd" + "pushd_ignore_dups" + "pushdminus" + "rmstarsilent" + "nonomatch" + "long_list_jobs" + "interactivecomments" + "append_history" + "hist_ignore_space" + "hist_verify" + "inc_append_history" + "nosharehistory" + "nomenu_complete" + "auto_menu" + "no_auto_remove_slash" + "complete_in_word" + "always_to_end" + "nolistbeep" + "autolist" + "listrowsfirst" + ]; + in '' + ${ + if pkgs.hostPlatform.isLinux + 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 + ${ + if pkgs.hostPlatform.isDarwin + 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"; + }) + ]; + 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 + ]); + }; + + home.sessionVariables = { + XDG_DATA_HOME = "${config.xdg.dataHome}"; + }; +} diff --git a/home/state.nix b/kat/state.nix similarity index 100% rename from home/state.nix rename to kat/state.nix diff --git a/kat/user/common.nix b/kat/user/common.nix new file mode 100644 index 00000000..38428092 --- /dev/null +++ b/kat/user/common.nix @@ -0,0 +1,6 @@ +{pkgs,tree,...}: { + users.users.kat = { + inherit (import tree.kat.user.data) description; + shell = pkgs.zsh; + }; +} diff --git a/kat/user/darwin.nix b/kat/user/darwin.nix new file mode 100644 index 00000000..1afd4944 --- /dev/null +++ b/kat/user/darwin.nix @@ -0,0 +1,10 @@ +_: { + users.users.kat = { + name = "kat"; + home = "/Users/kat"; + uid = 501; + }; + users.knownUsers = [ + "kat" + ]; +} diff --git a/kat/user/data.nix b/kat/user/data.nix new file mode 100644 index 00000000..c425d4e8 --- /dev/null +++ b/kat/user/data.nix @@ -0,0 +1,10 @@ +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}" ]; + keyid = "9CC644B569CDA59BC874C4C9E8DDE3ED1C90F3A0"; + keygrip = "59921D2F4E6DF7EEC3CB2934BD3D53666007B1AB"; + userName = description; + userEmail = email; + key = keyid; +} diff --git a/home/default.nix b/kat/user/default.nix similarity index 58% rename from home/default.nix rename to kat/user/default.nix index 6c7b7d05..62c53c3e 100644 --- a/home/default.nix +++ b/kat/user/default.nix @@ -1,17 +1,16 @@ {tree, ...}: tree.prev // { - base = { + nixos = { imports = with tree.prev; [ - base16 - shell - neovim + nixos + common ]; }; - work = { + darwin = { imports = with tree.prev; [ - work - wezterm + darwin + common ]; }; } diff --git a/kat/user/nixos.nix b/kat/user/nixos.nix new file mode 100644 index 00000000..344839f9 --- /dev/null +++ b/kat/user/nixos.nix @@ -0,0 +1,17 @@ +{tree,...}: { + users.users.kat = { + uid = 1000; + isNormalUser = true; + openssh.authorizedKeys = { + inherit (import tree.kat.user.data) keys; + }; + extraGroups = [ + "wheel" + "video" + "systemd-journal" + "plugdev" + "input" + "uinput" + ]; + }; +} diff --git a/home/wezterm.nix b/kat/wezterm.nix similarity index 100% rename from home/wezterm.nix rename to kat/wezterm.nix diff --git a/darwin/modules/blank.nix b/modules/darwin/blank.nix similarity index 100% rename from darwin/modules/blank.nix rename to modules/darwin/blank.nix diff --git a/home/modules/blank.nix b/modules/home/blank.nix similarity index 100% rename from home/modules/blank.nix rename to modules/home/blank.nix diff --git a/home/modules/disable.nix b/modules/home/disable.nix similarity index 100% rename from home/modules/disable.nix rename to modules/home/disable.nix diff --git a/home/modules/neovim.nix b/modules/home/neovim.nix similarity index 100% rename from home/modules/neovim.nix rename to modules/home/neovim.nix diff --git a/modules/home/zsh.nix b/modules/home/zsh.nix new file mode 100644 index 00000000..4ebbfac9 --- /dev/null +++ b/modules/home/zsh.nix @@ -0,0 +1,5 @@ +_: { + programs.zsh.initExtraFirst = '' + source /etc/static/zshrc + ''; +} diff --git a/nixos/modules/blank.nix b/modules/nixos/blank.nix similarity index 100% rename from nixos/modules/blank.nix rename to modules/nixos/blank.nix diff --git a/nixos/base.nix b/nixos/common.nix similarity index 100% rename from nixos/base.nix rename to nixos/common.nix diff --git a/nixos/users/kat.nix b/nixos/users/kat.nix deleted file mode 100644 index 2edc7869..00000000 --- a/nixos/users/kat.nix +++ /dev/null @@ -1,20 +0,0 @@ -_: { - users.users.kat = { - uid = 1000; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCocjQqiDIvzq+Qu3jkf7FXw5piwtvZ1Mihw9cVjdVcsra3U2c9WYtYrA3rS50N3p00oUqQm9z1KUrvHzdE+03ZCrvaGdrtYVsaeoCuuvw7qxTQRbItTAEsfRcZLQ5c1v/57HNYNEsjVrt8VukMPRXWgl+lmzh37dd9w45cCY1QPi+JXQQ/4i9Vc3aWSe4X6PHOEMSBHxepnxm5VNHm4PObGcVbjBf0OkunMeztd1YYA9sEPyEK3b8IHxDl34e5t6NDLCIDz0N/UgzCxSxoz+YJ0feQuZtud/YLkuQcMxW2dSGvnJ0nYy7SA5DkW1oqcy6CGDndHl5StOlJ1IF9aGh0gGkx5SRrV7HOGvapR60RphKrR5zQbFFka99kvSQgOZqSB3CGDEQGHv8dXKXIFlzX78jjWDOBT67vA/M9BK9FS2iNnBF5x6shJ9SU5IK4ySxq8qvN7Us8emkN3pyO8yqgsSOzzJT1JmWUAx0tZWG/BwKcFBHfceAPQl6pwxx28TM3BTBRYdzPJLTkAy48y6iXW6UYdfAPlShy79IYjQtEThTuIiEzdzgYdros0x3PDniuAP0KOKMgbikr0gRa6zahPjf0qqBnHeLB6nHAfaVzI0aNbhOg2bdOueE1FX0x48sjKqjOpjlIfq4WeZp9REr2YHEsoLFOBfgId5P3BPtpBQ== yubikey5" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPsu3vNsvBb/G+wALpstD/DnoRZ3fipAs00jtl8rzDuv96RlS7AJr4aNvG6Pt2D9SYn2wVLaiw+76mz2gOycH9/N+VCvL4/0MN9uqj+7XIcxNRo0gHVOblmi2bOXcmGKh3eRwHj1xyDwRxo9WIuBEP2bPpDPz75OXRtEdlTgvky7siSguQxJu03cb0p9hNAYhUoohNXyWW2CjDCLUQVE1+QRVUzsKq3KkPy0cHYgmZC1gRSMQyKpMt72L5tayLz3Tp/zrshucc+QO5IJeZdqMxsNAcvALsysT1J5EqxZoYH9VpWLRhSgVD6Nvn853pycJAlXQxgOCpSD3/v/JbgUe5NE+ci0o7NMy5IiHUv2gQMRIEhwBHlRGwokUPL9upx0lsjaEiPya5xQqqDKRom87xytM778ANS5CuMdQMWg9qVbpHZUHMjA0QmNkjPgq71pUDXHk5L4mZuS8wVjyjnvlw68yIJuHEc8P7QiLcjvRHFS2L9Ck8NRmPDTQXlQi9kk6LmMyu6fdevR/kZL21b+xO1e2DMyxBbNDTot8luppiiL8adgUDMwptpIne7JCWB1o9NFCbXUVgwuCCYBif6pOGSc6bGo1JTAKMflRlcy6Mi3t5H0mR2lj/sCSTWwTlP5FM4aPIq08NvW6PeuK1bFJY9fIgTwVsUnbAKOhmsMt62w== cardno:12 078 454" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII74JrgGsDQ6r7tD7+k3ykxXV7DpeeFRscPMxrBsDPhz kat@goliath" - ]; - shell = pkgs.zsh; - extraGroups = [ - "wheel" - "video" - "systemd-journal" - "plugdev" - "input" - "uinput" - ]; - }; -} diff --git a/systems/default.nix b/systems/default.nix index 4bb9d83e..491ad8a1 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -71,8 +71,10 @@ } .${toLower config.type}; modules = with tree; [ - tree.${config.folder}.modules - system + tree.modules.${config.folder} + tree.${config.folder}.common + tree.kat.user.${config.folder} + common ]; builder = { diff --git a/systems/sumireko.nix b/systems/sumireko.nix index b5c1568a..74d12625 100644 --- a/systems/sumireko.nix +++ b/systems/sumireko.nix @@ -1,8 +1,7 @@ _: let hostConfig = {tree, ...}: { imports = with tree; [ - darwin.base - darwin.kat + kat.work ]; security.pam.enableSudoTouchIdAuth = true; diff --git a/tree.nix b/tree.nix index 4352515b..fd961b2a 100644 --- a/tree.nix +++ b/tree.nix @@ -25,15 +25,16 @@ ]; }; # Required for all-system common imports - system.functor.enable = true; + common.functor.enable = true; # Re-map home directory profiles - home.evaluateDefault = true; + kat.evaluateDefault = true; + "kat/user".evaluateDefault = true; # Allow profile importing "nixos/*".functor.enable = true; "darwin/*".functor.enable = true; - "home/*".functor.enable = true; + "kat/*".functor.enable = true; # Various modules - "nixos/modules" = { + "modules/nixos" = { functor = { enable = true; external = with inputs; @@ -48,7 +49,7 @@ ]); }; }; - "darwin/modules" = { + "modules/darwin" = { functor = { enable = true; external = with inputs; [ @@ -57,7 +58,7 @@ ]; }; }; - "home/modules" = { + "modules/home" = { functor = { enable = true; external = with inputs;