@@ -0,0 +1,27 @@
1+{
2+ description = "The purely functional package manager";
3+
4+ inputs.nixpkgs.url = "nixpkgs/nixos-20.03-small";
5+
6+ outputs = { self, nixpkgs }: let
7+ systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
8+ forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
9+ in {
10+ exporters = forAllSystems (system: let
11+ nixpkgs' = nixpkgs.legacyPackages.${system};
12+ nix-bundle = import self { nixpkgs = nixpkgs'; };
13+ in {
14+ nix-bundle = { program }: let
15+ script = nixpkgs'.writeScript "startup" ''
16+ #!/bin/sh
17+ .${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -- ${program} $@
18+ '';
19+ in nix-bundle.makebootstrap {
20+ targets = [ script ];
21+ startup = ".${builtins.unsafeDiscardStringContext script} '\"$@\"'";
22+ };
23+ });
24+
25+ defaultExporter = forAllSystems (system: self.exporters.${system}.nix-bundle);
26+ };
27+}