aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/flake-bundler.sh35
-rw-r--r--tests/local.mk1
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/flake-bundler.sh b/tests/flake-bundler.sh
new file mode 100644
index 000000000..699920f60
--- /dev/null
+++ b/tests/flake-bundler.sh
@@ -0,0 +1,35 @@
+source common.sh
+
+clearStore
+rm -rf $TEST_HOME/.cache $TEST_HOME/.config $TEST_HOME/.local
+
+cp ./simple.nix ./simple.builder.sh ./config.nix $TEST_HOME
+
+cd $TEST_HOME
+
+cat <<EOF > flake.nix
+{
+ outputs = {self}: {
+ bundlers.$system.simple = drv:
+ if drv?type && drv.type == "derivation"
+ then drv
+ else self.defaultPackage.$system;
+ defaultBundler.$system = self.bundlers.$system.simple;
+ defaultPackage.$system = import ./simple.nix;
+ defaultApp.$system = {
+ type = "app";
+ program = "\${import ./simple.nix}/hello";
+ };
+ };
+}
+EOF
+nix build .#
+nix bundle --bundler .# .#
+nix bundle --bundler .#defaultBundler.$system .#defaultPackage.$system
+nix bundle --bundler .#bundlers.$system.simple .#defaultPackage.$system
+
+nix bundle --bundler .#defaultBundler.$system .#defaultApp.$system
+nix bundle --bundler .#bundlers.$system.simple .#defaultApp.$system
+
+clearStore
+
diff --git a/tests/local.mk b/tests/local.mk
index 2ec9baa12..47717fa67 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -48,6 +48,7 @@ nix_tests = \
flakes.sh \
flake-local-settings.sh \
flake-searching.sh \
+ flake-bundler.sh \
build.sh \
repl.sh ca/repl.sh \
ca/build.sh \