From 490d375e296bb87dbf3b2ff5dd3c049cbafa6b9a Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 12 Jun 2024 07:07:19 -0500 Subject: [PATCH] refactor(nix/hm/price): improve handling of dotnet --- users/price/conf/dotnet/default.nix | 16 ++++++++++++++++ .../.config/zsh/config/profile/profile/env.zsh | 12 ++++++------ users/price/home.nix | 2 -- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 users/price/conf/dotnet/default.nix diff --git a/users/price/conf/dotnet/default.nix b/users/price/conf/dotnet/default.nix new file mode 100644 index 00000000..1a5280a0 --- /dev/null +++ b/users/price/conf/dotnet/default.nix @@ -0,0 +1,16 @@ +{ pkgs, config, ... }: +{ + home = { + packages = with pkgs; [ + dotnet-sdk_8 + csharp-ls + ]; + sessionVariables = rec { + OMNISHARPHOME = "${config.xdg.configHome}/omnisharp"; + NUGET_PACKAGES = "${config.xdg.dataHome}/NuGetPackages"; + DOTNET_ROOT = "${config.xdg.dataHome}/Dotnet"; + DOTNET_CLI_HOME = DOTNET_ROOT; + DOTNET_CLI_TELEMETRY_OPTOUT = 1; + }; + }; +} diff --git a/users/price/dots/.config/zsh/config/profile/profile/env.zsh b/users/price/dots/.config/zsh/config/profile/profile/env.zsh index 6bc2603f..a8c19738 100644 --- a/users/price/dots/.config/zsh/config/profile/profile/env.zsh +++ b/users/price/dots/.config/zsh/config/profile/profile/env.zsh @@ -139,13 +139,13 @@ fi export PATH="${PATH}:${CARGO_HOME}/bin" ## Dotnet ### -export DOTNET_CLI_HOME="${XDG_DATA_HOME}/dotnet" -export DOTNET_ROOT="${XDG_DATA_HOME}/dotnet" -export PATH="${PATH}:${XDG_DATA_HOME}/dotnet" +export DOTNET_ROOT="${DOTNET_ROOT:-"$XDG_DATA_HOME/dotnet"}" +export DOTNET_CLI_HOME="${DOTNET_ROOT}" export DOTNET_CLI_TELEMETRY_OPTOUT=1 -export NUGET_PACKAGES="${XDG_DATA_HOME}/NugetPackages" -export OMNISHARPHOME="${XDG_CONFIG_HOME}/omnisharp" -export PATH="${PATH}:${HOME}/.dotnet/tools" +export NUGET_PACKAGES="${NUGET_PACKAGES:-"$XDG_DATA_HOME/NugetPackages"}" +export OMNISHARPHOME="${OMNISHARPHOME:-"$XDG_CONFIG_HOME/omnisharp"}" +export PATH="${PATH}:${DOTNET_ROOT}" +export PATH="${PATH}:${DOTNET_CLI_HOME}/tools" ### Go ### export GOPATH="${XDG_DATA_HOME}/go" diff --git a/users/price/home.nix b/users/price/home.nix index 27c1e8e0..bdefd2b6 100644 --- a/users/price/home.nix +++ b/users/price/home.nix @@ -34,7 +34,6 @@ in deno powershell vesktop - csharp-ls vimiv-qt kooha libreoffice-fresh @@ -62,7 +61,6 @@ in swaylock-effects luajit imagemagick - dotnet-sdk_8 shellcheck openjdk nodejs