From 7c5c3cd576784429b0b0d4fc7071113e454f9d8c Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sun, 28 Jul 2024 20:34:53 -0700 Subject: [PATCH] Converted direnv from nixosModule to homeModule --- homes/x86_64-linux/alejandro/default.nix | 1 + modules/home/tools/direnv/default.nix | 21 ++++++++++++++++++ modules/nixos/suites/development/default.nix | 2 +- modules/nixos/tools/direnv/default.nix | 23 -------------------- 4 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 modules/home/tools/direnv/default.nix delete mode 100644 modules/nixos/tools/direnv/default.nix diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index dc00108..4680d2c 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -13,6 +13,7 @@ }; tools = { + direnv.enable = true; git.enable = true; }; }; diff --git a/modules/home/tools/direnv/default.nix b/modules/home/tools/direnv/default.nix new file mode 100644 index 0000000..2854ee0 --- /dev/null +++ b/modules/home/tools/direnv/default.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + namespace, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.${namespace}.tools.direnv; +in { + options.${namespace}.tools.direnv = { + enable = mkEnableOption "direnv"; + }; + + config = mkIf cfg.enable { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/modules/nixos/suites/development/default.nix b/modules/nixos/suites/development/default.nix index 3eca7dd..7dfac5c 100644 --- a/modules/nixos/suites/development/default.nix +++ b/modules/nixos/suites/development/default.nix @@ -14,7 +14,6 @@ in { config = mkIf cfg.enable { aa = { tools = { - direnv.enable = true; eza.enable = true; gpg.enable = true; zsh.enable = true; @@ -27,6 +26,7 @@ in { environment.systemPackages = with pkgs; [ awscli2 + direnv minio-client pre-commit git diff --git a/modules/nixos/tools/direnv/default.nix b/modules/nixos/tools/direnv/default.nix deleted file mode 100644 index 005eab7..0000000 --- a/modules/nixos/tools/direnv/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - options, - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.aa.tools.direnv; -in { - options.aa.tools.direnv = with lib.types; { - enable = mkEnableOption "direnv"; - }; - - config = mkIf cfg.enable { - aa.home.extraOptions = { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; - }; -}