diff --git a/home-manager/dev/asdf.nix b/home-manager/dev/asdf.nix new file mode 100644 index 00000000..5ef09862 --- /dev/null +++ b/home-manager/dev/asdf.nix @@ -0,0 +1,30 @@ +{ + config, + pkgs, + lib, + ... +}: + +{ + options.home-manager.dev.asdf.enable = lib.mkEnableOption "asdf config" // { + default = config.home-manager.dev.enable; + }; + + config = lib.mkIf config.home-manager.dev.asdf.enable { + home = { + file.".asdfrc".text = lib.generators.toKeyValue {} { + legacy_version_file = "yes"; + }; + + packages = with pkgs; [ asdf-vm ]; + }; + + programs.zsh = { + initExtra = '' + export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed + fpath+=(${pkgs.asdf-vm}/share/zsh/site-functions) + source "${pkgs.asdf-vm}/share/asdf-vm/asdf.sh" + ''; + }; + }; +} diff --git a/home-manager/dev/default.nix b/home-manager/dev/default.nix index 4ad314ee..0db832ef 100644 --- a/home-manager/dev/default.nix +++ b/home-manager/dev/default.nix @@ -8,6 +8,7 @@ { imports = [ + ./asdf.nix ./clojure.nix ./go.nix ./nix.nix