aboutsummaryrefslogtreecommitdiff
path: root/tests/flakes
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-07-13 20:49:07 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-07-13 20:49:07 +0200
commit7abcafcfeacad587ccf1a7e58334958e25cef5b8 (patch)
treec4a5f0526fd842678309bf2893e4e4741686ea28 /tests/flakes
parentd16f1070f42be987093e2252c1e7bbebe0565ae0 (diff)
Move the 'nix bundle' tests
Note: these were previously not actually called.
Diffstat (limited to 'tests/flakes')
-rw-r--r--tests/flakes/bundle.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/flakes/bundle.sh b/tests/flakes/bundle.sh
new file mode 100644
index 000000000..67bbb05ac
--- /dev/null
+++ b/tests/flakes/bundle.sh
@@ -0,0 +1,32 @@
+source common.sh
+
+cp ../simple.nix ../simple.builder.sh ../config.nix $TEST_HOME
+
+cd $TEST_HOME
+
+cat <<EOF > flake.nix
+{
+ outputs = {self}: {
+ bundlers.$system = rec {
+ simple = drv:
+ if drv?type && drv.type == "derivation"
+ then drv
+ else self.packages.$system.default;
+ default = simple;
+ };
+ packages.$system.default = import ./simple.nix;
+ apps.$system.default = {
+ type = "app";
+ program = "\${import ./simple.nix}/hello";
+ };
+ };
+}
+EOF
+
+nix build .#
+nix bundle --bundler .# .#
+nix bundle --bundler .#bundlers.$system.default .#packages.$system.default
+nix bundle --bundler .#bundlers.$system.simple .#packages.$system.default
+
+nix bundle --bundler .#bundlers.$system.default .#apps.$system.default
+nix bundle --bundler .#bundlers.$system.simple .#apps.$system.default