aboutsummaryrefslogtreecommitdiff
path: root/src/nix/post-install-steps.sh
diff options
context:
space:
mode:
authorChuck Lantz <clantz@microsoft.com>2022-11-01 20:02:02 +0300
committerGitHub <noreply@github.com>2022-11-01 20:02:02 +0300
commit0752a52b0c8ac76448666822938dce8f4d55bb69 (patch)
tree39abf9124899027643a68e5d33afc78f92ecedd9 /src/nix/post-install-steps.sh
parent748be9320c99cbf6e6a2885d3b5dcc39e7ad3b78 (diff)
Nix feature (#228)
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