aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-03 23:40:20 +0100
committerGitHub <noreply@github.com>2022-02-03 23:40:20 +0100
commit1aa5994e6d7bfb32895264c3a2f1d94cc7272a72 (patch)
tree006cd6d3ff1e7781ba4583d5ebbf1245a21837bf /tests
parentfcb33440b6d3038e6761e546fc9434fa8e9a1666 (diff)
parent12ff354d016058b25245d7e75d5b0c8ff7323839 (diff)
Merge pull request #5456 from tomberek/bundler_drv
bundle: pass drv attrset instead of path
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 \