Skip to content

Commit

Permalink
Merge pull request nix-community#161 from tomeon/nix-2.7-app-output-s…
Browse files Browse the repository at this point in the history
…chema-fix

Nix >= 2.7 app.<system>.default compat
  • Loading branch information
Lassulus authored Jun 22, 2022
2 parents fb3ee0f + 8feb8fa commit 0e6a63c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@
buildInputs = with pkgs; [ jq coreutils findutils ];
});

# Make it runnable with `nix app`
apps = forAllSystems (system: {
# Make it runnable with `nix run`
apps = forAllSystems (system: let
nixos-generate = {
type = "app";
program = "${self.packages."${system}".nixos-generators}/bin/nixos-generate";
};
in {
inherit nixos-generate;

# Nix >= 2.7 flake output schema uses `apps.<system>.default` instead
# of `defaultApp.<system>` to signify the default app (the thing that
# gets run with `nix run . -- <args>`)
default = nixos-generate;
});

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

0 comments on commit 0e6a63c

Please sign in to comment.