From 3bd0c5009031773155d8e5a35987b84ae1353ff9 Mon Sep 17 00:00:00 2001 From: Michael Forster Date: Wed, 11 Jan 2023 09:09:39 +0100 Subject: [PATCH] Fix `nix run` Otherwise nix 2.8 and newer will give this error message: ``` >> nix --version; nix run github:martinvonz/jj nix (Nix) 2.11.1 error: attribute 'defaultApp.x86_64-linux' should have type 'derivation' ``` --- flake.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 1e0aa50da..ae2aed3dc 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ foreachSystem = f: lib.foldl' (attrs: system: lib.recursiveUpdate attrs (f system)) { } systems; in { - overlay = (final: prev: { + overlays.default = (final: prev: { jujutsu = final.callPackage ( { stdenv @@ -78,13 +78,15 @@ let pkgs = import nixpkgs { inherit system; - overlays = [ self.overlay ]; + overlays = [ self.overlays.default ]; }; in { - packages.${system}.jujutsu = pkgs.jujutsu; - defaultPackage.${system} = self.packages.${system}.jujutsu; - defaultApp.${system} = { + packages.${system} = { + jujutsu = pkgs.jujutsu; + default = self.packages.${system}.jujutsu; + }; + apps.${system}.default = { type = "app"; program = "${pkgs.jujutsu}/bin/jj"; };