nix package installer

This commit is contained in:
randogoth 2025-12-23 19:34:21 +02:00
parent 9e859af388
commit 9d5b4ddecd
3 changed files with 27 additions and 7 deletions

23
files/scripts/nixpkgs.sh Normal file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -oue pipefail
nix run github:nix-community/home-manager/release-25.11 -- init --switch
pkgs='uv micro vscodium mc lagrange'
f=~/.config/home-manager/home.nix
tmp="$(mktemp)"
{
echo " home.packages = ["
for p in $pkgs; do echo " pkgs.$p"; done
echo " ];"
} > "$tmp"
sed -i "/^[[:space:]]*home\.packages[[:space:]]*=[[:space:]]*\[/,/^[[:space:]]*];[[:space:]]*$/{
/^[[:space:]]*home\.packages[[:space:]]*=/{
r $tmp
}
d
}" "$f"
rm -f "$tmp"
home-manager switch