aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/flakes/bundle.sh
blob: 67bbb05ac5b2914e71f782b1ac8d9312a42a50ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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