From f977af61a99a5154abf35ced5c52bb7c723c0635 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 10 Apr 2024 23:32:38 +0200 Subject: [PATCH] chore: put direnv in a module --- home-manager/cli/direnv.nix | 7 ------- hosts/luci/home-config.nix | 1 + modules/home-manager/cli/direnv/default.nix | 18 ++++++++++++++++++ modules/home-manager/default.nix | 1 + 4 files changed, 20 insertions(+), 7 deletions(-) delete mode 100644 home-manager/cli/direnv.nix create mode 100644 modules/home-manager/cli/direnv/default.nix diff --git a/home-manager/cli/direnv.nix b/home-manager/cli/direnv.nix deleted file mode 100644 index 2d198c6..0000000 --- a/home-manager/cli/direnv.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - programs.direnv = { - enable = true; - enableZshIntegration = true; # see note on other shells below - nix-direnv.enable = true; - }; -} diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 8862230..b8f7836 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -6,6 +6,7 @@ foot.enable = true; }; cli = { + direnv.enable = true; ghq.enable = true; git.enable = true; neovim.enable = true; diff --git a/modules/home-manager/cli/direnv/default.nix b/modules/home-manager/cli/direnv/default.nix new file mode 100644 index 0000000..7397289 --- /dev/null +++ b/modules/home-manager/cli/direnv/default.nix @@ -0,0 +1,18 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.modules.cli.direnv; +in +{ + options.modules.cli.direnv = { + enable = mkEnableOption "enable direnv"; + }; + + config = mkIf cfg.enable { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index e400610..435bc9a 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -5,6 +5,7 @@ ./application/gnupg ./application/imv ./application/zathura + ./cli/direnv ./cli/ghq/default.nix ./cli/git ./cli/neovim