aboutsummaryrefslogtreecommitdiff
path: root/src/nix/post-install-steps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/post-install-steps.sh')
-rwxr-xr-xsrc/nix/post-install-steps.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nix/post-install-steps.sh b/src/nix/post-install-steps.sh
new file mode 100755
index 0000000..aa46679
--- /dev/null
+++ b/src/nix/post-install-steps.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -e
+echo "(*) Executing post-installation steps..."
+
+# Install list of packages in profile if specified.
+if [ ! -z "${PACKAGES}" ] && [ "${PACKAGES}" != "none" ]; then
+ echo "Installing packages \"${PACKAGES}\" in profile..."
+ nix-env --install ${PACKAGES}
+fi
+
+# Install Nix flake in profile if specified
+if [ ! -z "${FLAKEURI}" ] && [ "${FLAKEURI}" != "none" ]; then
+ echo "Installing flake ${FLAKEURI} in profile..."
+ nix profile install "${FLAKEURI}"
+fi
+
+nix-collect-garbage --delete-old
+nix-store --optimise