From 9d5b4ddecd2cd8b672c8f358150f7f8b57a2b31d Mon Sep 17 00:00:00 2001 From: randogoth Date: Tue, 23 Dec 2025 19:34:21 +0200 Subject: [PATCH] nix package installer --- files/scripts/example.sh | 6 ------ files/scripts/nixpkgs.sh | 23 +++++++++++++++++++++++ recipes/recipe.yml | 5 ++++- 3 files changed, 27 insertions(+), 7 deletions(-) delete mode 100644 files/scripts/example.sh create mode 100644 files/scripts/nixpkgs.sh diff --git a/files/scripts/example.sh b/files/scripts/example.sh deleted file mode 100644 index 1cded87..0000000 --- a/files/scripts/example.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Tell this script to exit if there are any errors. -# You should have this in every custom script, to ensure that your completed -# builds actually ran successfully without any errors! -set -oue pipefail \ No newline at end of file diff --git a/files/scripts/nixpkgs.sh b/files/scripts/nixpkgs.sh new file mode 100644 index 0000000..cd7ecf9 --- /dev/null +++ b/files/scripts/nixpkgs.sh @@ -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 diff --git a/recipes/recipe.yml b/recipes/recipe.yml index 93eccea..d1b2bb9 100644 --- a/recipes/recipe.yml +++ b/recipes/recipe.yml @@ -60,10 +60,13 @@ modules: # If no repo information is specified, Flathub will be used by default install: # system flatpaks we want all users to have and not remove - net.waterfox.waterfox - - com.vscodium.codium - org.telegram.desktop remove: # replace default Firefox with Waterfox - org.mozilla.firefox - scope: user # Also add Flathub user repo, but no user packages + - type: script + scripts: + - nixpkgs.sh + - type: signing # this sets up the proper policy & signing files for signed images to work fully