From 9a1227daf7b5e04d9db7b0b9b77b4571fc3482b9 Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Wed, 24 Jun 2026 13:01:29 -0500 Subject: [PATCH] Move shell/zsh config to den module --- _old/shell/bash.nix | 17 -------- _old/shell/default.nix | 46 -------------------- _old/shell/zsh.nix | 53 ----------------------- modules/bat.nix | 10 +++++ modules/igneous.nix | 15 +++---- modules/shell/bash.nix | 15 +++++++ {_old => modules}/shell/completions.zsh | 0 {_old => modules}/shell/keybindings.zsh | 0 modules/shell/shell.nix | 16 +++++++ modules/shell/zsh.nix | 57 +++++++++++++++++++++++++ 10 files changed, 105 insertions(+), 124 deletions(-) delete mode 100644 _old/shell/bash.nix delete mode 100644 _old/shell/default.nix delete mode 100644 _old/shell/zsh.nix create mode 100644 modules/bat.nix create mode 100644 modules/shell/bash.nix rename {_old => modules}/shell/completions.zsh (100%) rename {_old => modules}/shell/keybindings.zsh (100%) create mode 100644 modules/shell/shell.nix create mode 100644 modules/shell/zsh.nix diff --git a/_old/shell/bash.nix b/_old/shell/bash.nix deleted file mode 100644 index 28bee36..0000000 --- a/_old/shell/bash.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - programs.bash = { - enable = true; - historyFile = ".bashhistfile"; - historyIgnore = [ - "ls" - "cd" - "exit" - ]; - }; -} diff --git a/_old/shell/default.nix b/_old/shell/default.nix deleted file mode 100644 index 6ff9d01..0000000 --- a/_old/shell/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - imports = [ - ./bash.nix - ./zsh.nix - ]; - - home.sessionVariables = { - EDITOR = "nvim"; - }; - - home.shellAliases = { - clstat = "clear && git status"; - vim = "nvim"; - - ga = "git add"; - gaa = "git add ."; - gc = "git commit --message"; - gca = "git commit --amend"; - "gca!" = "git commit --amend --no-edit"; - gd = "git diff"; - gds = "git diff --staged"; - glol = "git log --graph --pretty=\"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset\""; - glola = "git log --graph --pretty=\"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset\" --all"; - gp = "git push"; - "gp!" = "git push --force"; - gpl = "git pull"; - gr = "git restore"; - grs = "git restore --staged"; - gs = "git status"; - - nix-zsh = "nix-shell --command zsh"; - - tree = "tree --gitignore"; - }; - - programs.starship = { - enable = true; - enableZshIntegration = true; - }; -} diff --git a/_old/shell/zsh.nix b/_old/shell/zsh.nix deleted file mode 100644 index 35013bb..0000000 --- a/_old/shell/zsh.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - completions = builtins.readFile ./completions.zsh; - keybindings = builtins.readFile ./keybindings.zsh; -in -{ - programs.zsh = { - enable = true; - enableCompletion = true; - enableVteIntegration = true; - - defaultKeymap = "emacs"; - - history = { - append = true; - findNoDups = true; - }; - - setOptions = [ - "NOMATCH" - "NOTIFY" - "NO_BEEP" - ]; - - # Loal completion settings - # initContent = lib.mkOrder 550 completions; - initContent = lib.mkMerge [ - (lib.mkOrder 550 completions) - (lib.mkOrder 1000 keybindings) - ]; - - # Load plugins manually - plugins = [ - { - name = "sudo"; - file = "plugins/sudo/sudo.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "ohmyzsh"; - repo = "ohmyzsh"; - rev = "beadd56dd75e8a40fe0a7d4a5d63ed5bf9efcd48"; - sha256 = "sha256-e3zTM3rj4z6RwDai9i7KKrz6imTGmZiSAqcS9Mw2LZU="; - }; - } - ]; - - syntaxHighlighting.enable = true; - }; -} diff --git a/modules/bat.nix b/modules/bat.nix new file mode 100644 index 0000000..8d59f94 --- /dev/null +++ b/modules/bat.nix @@ -0,0 +1,10 @@ +{ + den.aspects.bat = { + homeManager = { + programs.bat = { + enable = true; + config.theme = "Catppuccin Frappe"; + }; + }; + }; +} diff --git a/modules/igneous.nix b/modules/igneous.nix index 208da00..030964e 100644 --- a/modules/igneous.nix +++ b/modules/igneous.nix @@ -2,10 +2,14 @@ { # user aspect den.aspects.igneous = { - includes = [ + includes = with den.aspects; [ den.batteries.define-user den.batteries.primary-user - (den.batteries.user-shell "zsh") + + bat + shell + shell.bash + shell.zsh ]; homeManager = @@ -19,16 +23,11 @@ nixfmt tree ]; - - programs.bat = { - enable = true; - config.theme = "Catppuccin Frappe"; - }; }; # user can provide NixOS configurations # to any host it is included on - provides.to-hosts.nixos = { pkgs, ... }: { + provides.to-hosts.nixos = { environment.pathsToLink = [ "/share/zsh" ]; }; }; diff --git a/modules/shell/bash.nix b/modules/shell/bash.nix new file mode 100644 index 0000000..441cb59 --- /dev/null +++ b/modules/shell/bash.nix @@ -0,0 +1,15 @@ +{ + den.aspects.shell.bash = { + homeManager = { + programs.bash = { + enable = true; + historyFile = "~/.bashhistfile"; + historyIgnore = [ + "ls" + "cd" + "exit" + ]; + }; + }; + }; +} diff --git a/_old/shell/completions.zsh b/modules/shell/completions.zsh similarity index 100% rename from _old/shell/completions.zsh rename to modules/shell/completions.zsh diff --git a/_old/shell/keybindings.zsh b/modules/shell/keybindings.zsh similarity index 100% rename from _old/shell/keybindings.zsh rename to modules/shell/keybindings.zsh diff --git a/modules/shell/shell.nix b/modules/shell/shell.nix new file mode 100644 index 0000000..114eb76 --- /dev/null +++ b/modules/shell/shell.nix @@ -0,0 +1,16 @@ +{ + den.aspects.shell = { + homeManager = { + home.shellAliases = { + nix-zsh = "nix-shell --command zsh"; + tree = "tree --gitignore"; + }; + + programs.starship = { + enable = true; + enableZshIntegration = true; + enableBashIntegration = true; + }; + }; + }; +} diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix new file mode 100644 index 0000000..6508f14 --- /dev/null +++ b/modules/shell/zsh.nix @@ -0,0 +1,57 @@ +{ + den, + ... +}: +let + completions = builtins.readFile ./completions.zsh; + keybindings = builtins.readFile ./keybindings.zsh; +in +{ + den.aspects.shell.zsh = { + includes = [ (den.batteries.user-shell "zsh") ]; + + homeManager = { lib, pkgs, ... }: { + programs.zsh = { + enable = true; + enableCompletion = true; + enableVteIntegration = true; + + defaultKeymap = "emacs"; + + history = { + append = true; + findNoDups = true; + }; + + setOptions = [ + "NOMATCH" + "NOTIFY" + "NO_BEEP" + ]; + + # Loal completion settings + initContent = lib.mkMerge [ + (lib.mkOrder 550 completions) + (lib.mkOrder 1000 keybindings) + ]; + + # Load plugins manually + plugins = [ + { + name = "sudo"; + file = "plugins/sudo/sudo.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "ohmyzsh"; + repo = "ohmyzsh"; + rev = "beadd56dd75e8a40fe0a7d4a5d63ed5bf9efcd48"; + sha256 = "sha256-e3zTM3rj4z6RwDai9i7KKrz6imTGmZiSAqcS9Mw2LZU="; + }; + } + ]; + + syntaxHighlighting.enable = true; + }; + }; + }; + +} -- 2.51.2