refactor: make nixos-generator + /package.nix callPackage-eable

This commit is contained in:
David 2024-03-25 13:28:47 +01:00
parent 89f2a6dc56
commit 01f1b422e7
No known key found for this signature in database
GPG Key ID: AB15A6AF1101390D
2 changed files with 20 additions and 11 deletions

View File

@ -116,17 +116,7 @@
pkgs = nixpkgs.legacyPackages."${system}";
in rec {
default = nixos-generate;
nixos-generate = pkgs.stdenv.mkDerivation {
name = "nixos-generate";
src = ./.;
meta.description = "Collection of image builders";
nativeBuildInputs = with pkgs; [makeWrapper];
installFlags = ["PREFIX=$(out)"];
postFixup = ''
wrapProgram $out/bin/nixos-generate \
--prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [jq coreutils findutils])}
'';
};
nixos-generate = pkgs.callPackage ./package.nix {};
});
checks =

19
package.nix Normal file
View File

@ -0,0 +1,19 @@
{
stdenv,
makeWrapper,
jq,
coreutils,
findutils,
lib,
}:
stdenv.mkDerivation {
name = "nixos-generate";
src = ./.;
meta.description = "Collection of image builders";
nativeBuildInputs = [makeWrapper];
installFlags = ["PREFIX=$(out)"];
postFixup = ''
wrapProgram $out/bin/nixos-generate \
--prefix PATH : ${lib.makeBinPath [jq coreutils findutils]}
'';
}