Skip to content

Commit 0e6a63c

Browse files
authored
Merge pull request #161 from tomeon/nix-2.7-app-output-schema-fix
Nix >= 2.7 app.<system>.default compat
2 parents fb3ee0f + 8feb8fa commit 0e6a63c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

flake.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,19 @@
7474
buildInputs = with pkgs; [ jq coreutils findutils ];
7575
});
7676

77-
# Make it runnable with `nix app`
78-
apps = forAllSystems (system: {
77+
# Make it runnable with `nix run`
78+
apps = forAllSystems (system: let
7979
nixos-generate = {
8080
type = "app";
8181
program = "${self.packages."${system}".nixos-generators}/bin/nixos-generate";
8282
};
83+
in {
84+
inherit nixos-generate;
85+
86+
# Nix >= 2.7 flake output schema uses `apps.<system>.default` instead
87+
# of `defaultApp.<system>` to signify the default app (the thing that
88+
# gets run with `nix run . -- <args>`)
89+
default = nixos-generate;
8390
});
8491

8592
defaultApp = forAllSystems (system: self.apps."${system}".nixos-generate);

0 commit comments

Comments
 (0)