Compare commits

..

3 Commits

Author SHA1 Message Date
anmiller
ed643a06f9 Update removal for newer nix profile output 2024-09-30 16:58:09 +00:00
anmiller
c460081637 Update language servers/dev tools 2024-09-30 16:53:04 +00:00
anmiller
2f971627bd Update nix to 2.18.7 and conditionally add ssl-cert to conf.nix 2024-09-30 16:52:40 +00:00
2 changed files with 22 additions and 8 deletions

View File

@ -12,7 +12,7 @@ nix_packages=(
"yq" "yq"
"ruby" "ruby"
"solargraph" "shellcheck"
# Neovim + Plugin dependencies # Neovim + Plugin dependencies
"neovim" "neovim"
@ -20,9 +20,10 @@ nix_packages=(
"fzf" "fzf"
# Language servers # Language servers
"helm-ls" "helm-ls" # Helm
"yaml-language-server" "yaml-language-server" # Yaml
"lua-language-server" "lua-language-server" # Lua
"solargraph" # Ruby
# ProgrammingLanguages # ProgrammingLanguages
"lua52Packages.lua" "lua52Packages.lua"
@ -40,6 +41,8 @@ nix_packages=(
"kubernetes-helm" "kubernetes-helm"
"rancher" "rancher"
# Remote programming tools
"lemonade"
) )
unstable_packages=( unstable_packages=(
# CVE in NixOS stable version of vault # CVE in NixOS stable version of vault
@ -48,6 +51,9 @@ unstable_packages=(
# Need unstable latest up to date terraform/terragrunt # Need unstable latest up to date terraform/terragrunt
"terraform" "terraform"
"terragrunt" "terragrunt"
# Language servers
"gitlab-ci-ls"
) )
@ -106,7 +112,9 @@ install_nix_packages()
# The name of the package we are going to install, needed to check for presence/uninstall # The name of the package we are going to install, needed to check for presence/uninstall
package_name=packages.x86_64-linux.myPackageCollection package_name=packages.x86_64-linux.myPackageCollection
if [ "${nix_packages[*]}" ]; then if [ "${nix_packages[*]}" ]; then
if nix profile list | cut -d' ' -f 2 | grep -q "${package_name}"; then # Updated to process new nix profile format, proper processing probably needs JQ
# But JQ would be another dependency and this is good enough for now
if nix profile list --json | grep -i "\"attrPath\":\"${package_name}\""; then
echo "Removing previous version of profile" echo "Removing previous version of profile"
nix profile remove "${package_name}" nix profile remove "${package_name}"
fi fi

View File

@ -18,7 +18,7 @@ if [ "${USER:-}" == "root" ] || [ "${UID:-}" == "0" ]; then
fi fi
# Download the Nix installer and it's signature from NixOS.org # Download the Nix installer and it's signature from NixOS.org
curl -so install-nix https://releases.nixos.org/nix/nix-2.18.1/install curl -so install-nix https://releases.nixos.org/nix/nix-2.18.7/install
# Run the installer # Run the installer
sh ./install-nix sh ./install-nix
@ -35,7 +35,13 @@ EOF
rm -f ./install-nix rm -f ./install-nix
# Enable flakes and the nix command # Enable flakes and the nix command
mkdir -p ~/.config/nix NIX_CONF_DIR=~/.config/nix
cat <<EOF > ~/.config/nix/nix.conf NIX_CONF_FILE=${NIX_CONF_DIR}/nix.conf
mkdir -p ${NIX_CONF_DIR}
cat <<EOF > ${NIX_CONF_FILE}
experimental-features = flakes nix-command experimental-features = flakes nix-command
EOF EOF
# Conditionally add a link to system certificates for nix
if [ -f /etc/ssl/certs/ca-certificates.crt ]; then
echo 'ssl-cert-file = /etc/ssl/certs/ca-certificates.crt' >> ${NIX_CONF_FILE}
fi