Add sas devshell

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-07 14:11:56 +02:00
parent eb51d232f8
commit 32124eb8e2
2 changed files with 29 additions and 0 deletions

View File

@@ -107,6 +107,7 @@
nix = import ./hosts/common/shells/nix { inherit pkgs; };
nodejs = import ./hosts/common/shells/nodejs { inherit pkgs; };
python = import ./hosts/common/shells/python { inherit pkgs; };
sas = import ./hosts/common/shells/sas { inherit pkgs; };
};
formatter = pkgs.nixfmt-rfc-style;

View File

@@ -0,0 +1,28 @@
{ pkgs, ... }:
pkgs.mkShell {
packages = with pkgs; [
go
gopls
go-tools
golangci-lint
golangci-lint-langserver
jdk17
];
shellHook = ''
if git rev-parse --is-inside-work-tree &> /dev/null; then
TOP="$(git rev-parse --show-toplevel)"
if ! grep -q "^\.go$" "$TOP/.gitignore" "$TOP/.git/info/exclude"; then echo ".go" >> "$TOP/.git/info/exclude"; fi
if ! grep -q "^\.gradle$" "$TOP/.gitignore" "$TOP/.git/info/exclude"; then echo ".gradle" >> "$TOP/.git/info/exclude"; fi
else
TOP="$(pwd)"
fi
export GOPATH="$TOP/.go"
export GOPROXY=goproxy.unx.sas.com
export GONOSUMDB=*.sas.com,sassoftware.io
export JAVA_HOME="${pkgs.jdk17.home}"
export GRADLE_USER_HOME="$TOP/.gradle"
mkdir -p "$GRADLE_USER_HOME" && cp -f ~/.gradle/gradle.properties "$GRADLE_USER_HOME/gradle.properties"
'';
}