From 317ab0c0cd2cf89b5276facceb3ff21adcd62c9e Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 30 Sep 2024 10:21:31 +0100 Subject: [PATCH] home-manager/asdf: init --- home-manager/dev/asdf.nix | 30 ++++++++++++++++++++++++++++++ home-manager/dev/default.nix | 1 + 2 files changed, 31 insertions(+) create mode 100644 home-manager/dev/asdf.nix 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