From 97e4bf372be5c957e3619c84fcaad6a2fb615261 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Tue, 20 May 2025 11:43:16 +0800 Subject: [PATCH] refactor(homeModules/cli): move zsh config to module --- homes/x86_64-linux/rafiq/cli.nix | 7 ------- homes/x86_64-linux/rafiq/default.nix | 2 +- modules/home/cli/default.nix | 2 ++ .../rafiq/cli => modules/home/cli/shell}/zsh.nix | 2 ++ 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 homes/x86_64-linux/rafiq/cli.nix rename {homes/x86_64-linux/rafiq/cli => modules/home/cli/shell}/zsh.nix (84%) diff --git a/homes/x86_64-linux/rafiq/cli.nix b/homes/x86_64-linux/rafiq/cli.nix deleted file mode 100644 index 942a8f6..0000000 --- a/homes/x86_64-linux/rafiq/cli.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, lib, pkgs, osConfig, ... }: -{ - imports = [ - ./cli/zsh.nix - ]; - -} diff --git a/homes/x86_64-linux/rafiq/default.nix b/homes/x86_64-linux/rafiq/default.nix index f79cd78..d09491a 100644 --- a/homes/x86_64-linux/rafiq/default.nix +++ b/homes/x86_64-linux/rafiq/default.nix @@ -2,10 +2,10 @@ { imports = [ - ./cli.nix ./desktop.nix ]; + cli.shell = "zsh"; cli.editor = "nvf"; cli.file-browser = "yazi"; cli.git.name = "Mohammad Rafiq"; diff --git a/modules/home/cli/default.nix b/modules/home/cli/default.nix index c71af3a..d471526 100644 --- a/modules/home/cli/default.nix +++ b/modules/home/cli/default.nix @@ -3,10 +3,12 @@ imports = [ ./file-browser/yazi.nix ./editor/nvf.nix + ./shell/zsh.nix ./utilities/git.nix ]; options.cli = { + shell = lib.pantheon.mkStrOption; editor = lib.pantheon.mkStrOption; file-browser = lib.pantheon.mkStrOption; }; diff --git a/homes/x86_64-linux/rafiq/cli/zsh.nix b/modules/home/cli/shell/zsh.nix similarity index 84% rename from homes/x86_64-linux/rafiq/cli/zsh.nix rename to modules/home/cli/shell/zsh.nix index e0df0a3..cea07bd 100644 --- a/homes/x86_64-linux/rafiq/cli/zsh.nix +++ b/modules/home/cli/shell/zsh.nix @@ -1,5 +1,6 @@ { config, lib, ... }: { + config = lib.mkIf (config.cli.shell == "zsh") { home.sessionVariables.SHELL = "zsh"; programs.zsh = { enable = true; @@ -10,4 +11,5 @@ history.ignoreDups = true; history.ignoreSpace = true; }; + }; }