From 4ec61784ed258c4310bde26168c584cd25909441 Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Fri, 29 Nov 2024 00:44:04 -0600 Subject: [PATCH] modularize zsh --- home/modules/default.nix | 1 + home/modules/terminal/default.nix | 6 ------ home/modules/zsh/default.nix | 18 ++++++++++++++++++ home/modules/{terminal => zsh}/zshrc.nix | 2 +- .../fabian@posixlycorrect/default.nix | 2 ++ 5 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 home/modules/zsh/default.nix rename home/modules/{terminal => zsh}/zshrc.nix (98%) diff --git a/home/modules/default.nix b/home/modules/default.nix index 0ac2c86..5177476 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -12,5 +12,6 @@ ./yubikey.nix ./browsers.nix ./gui + ./zsh ]; } diff --git a/home/modules/terminal/default.nix b/home/modules/terminal/default.nix index 1914821..8d49497 100644 --- a/home/modules/terminal/default.nix +++ b/home/modules/terminal/default.nix @@ -34,12 +34,6 @@ in { }; }; - programs.zsh = { - enable = true; - syntaxHighlighting.enable = true; - initExtra = import ./zshrc.nix pkgs; - }; - programs.git = { enable = true; userEmail = "fabian@posixlycorrect.com"; diff --git a/home/modules/zsh/default.nix b/home/modules/zsh/default.nix new file mode 100644 index 0000000..6434908 --- /dev/null +++ b/home/modules/zsh/default.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.services.zsh; +in { + options.local.services.zsh.enable = mkEnableOption "zsh settings"; + config = mkIf cfg.enable { + programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + initExtra = import ./zshrc.nix pkgs; + }; + }; +} diff --git a/home/modules/terminal/zshrc.nix b/home/modules/zsh/zshrc.nix similarity index 98% rename from home/modules/terminal/zshrc.nix rename to home/modules/zsh/zshrc.nix index 2bcee01..6665b14 100644 --- a/home/modules/terminal/zshrc.nix +++ b/home/modules/zsh/zshrc.nix @@ -83,7 +83,7 @@ alias tree='tree -CF' alias lock="betterlockscreen -l" alias nightmode="${redshift}/bin/redshift -P -O 1000" - alias lightmode="${redshift}/bin/redshift -P -O 6500" + alias lightmode="${redshift}/bin/redshift -x=" alias inbox="echo >> $HOME/gtd/inbox" alias nixoide="nix repl ''" alias vps="ssh -A vps" diff --git a/home/platforms/fabian@posixlycorrect/default.nix b/home/platforms/fabian@posixlycorrect/default.nix index 6d16ec3..553234a 100644 --- a/home/platforms/fabian@posixlycorrect/default.nix +++ b/home/platforms/fabian@posixlycorrect/default.nix @@ -43,6 +43,8 @@ }; }; + local.services.zsh.enable = true; + home = { stateVersion = "21.11"; # No tocar esto username = "fabian";