Compare commits
2 commits
5cef18f07e
...
28573ba11f
Author | SHA1 | Date | |
---|---|---|---|
28573ba11f | |||
975068992f |
3 changed files with 14 additions and 13 deletions
|
@ -25,7 +25,7 @@ jobs:
|
||||||
- uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
- uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
- run: nix --version
|
- run: nix --version
|
||||||
- name: Generate size report
|
- name: Generate size report
|
||||||
uses: "https://git.salame.cl/jalil/nix-flake-outputs-size@6b0b78e4962d7aae6243b4601ba8257be99e3a70" # main
|
uses: "https://git.salame.cl/jalil/nix-flake-outputs-size@e5d1a0751adb4963c0a4982503806ae5f19f52da" # main
|
||||||
with:
|
with:
|
||||||
comment-on-pr: ${{ github.ref_name != 'main' }}
|
comment-on-pr: ${{ github.ref_name != 'main' }}
|
||||||
generate-artifact: ${{ github.ref_name == 'main' }}
|
generate-artifact: ${{ github.ref_name == 'main' }}
|
||||||
|
|
22
default.nix
22
default.nix
|
@ -1,15 +1,16 @@
|
||||||
|
let
|
||||||
|
inherit (builtins.getFlake (builtins.toString ./.)) inputs;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
pkgs ?
|
pkgs ? inputs.nixpkgs.legacyPackages.${builtins.currentSystem},
|
||||||
(builtins.getFlake (builtins.toString ./.)).inputs.nixpkgs.legacyPackages.${builtins.currentSystem},
|
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
crane ? (builtins.getFlake (builtins.toString ./.)).inputs.crane,
|
crane ? inputs.crane,
|
||||||
pkgSrc ? ./.,
|
craneLib ? crane.mkLib pkgs,
|
||||||
|
cargoArtifacts ? null,
|
||||||
|
src ? craneLib.cleanCargoSource ./.,
|
||||||
mold ? pkgs.mold,
|
mold ? pkgs.mold,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
craneLib = crane.mkLib pkgs;
|
|
||||||
src = craneLib.cleanCargoSource pkgSrc;
|
|
||||||
|
|
||||||
commonArgs = {
|
commonArgs = {
|
||||||
inherit src;
|
inherit src;
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
@ -26,12 +27,13 @@ let
|
||||||
mainProgram = "webnsupdate";
|
mainProgram = "webnsupdate";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
|
||||||
in
|
in
|
||||||
craneLib.buildPackage (
|
craneLib.buildPackage (
|
||||||
lib.mergeAttrsList [
|
lib.mergeAttrsList [
|
||||||
commonArgs
|
commonArgs
|
||||||
{ inherit cargoArtifacts; }
|
{
|
||||||
|
cargoArtifacts =
|
||||||
|
if cargoArtifacts == null then craneLib.buildDepsOnly commonArgs else cargoArtifacts;
|
||||||
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -44,8 +44,7 @@ in
|
||||||
{ inherit cargoArtifacts; }
|
{ inherit cargoArtifacts; }
|
||||||
];
|
];
|
||||||
webnsupdate = pkgs.callPackage ../default.nix {
|
webnsupdate = pkgs.callPackage ../default.nix {
|
||||||
inherit crane;
|
inherit craneLib cargoArtifacts src;
|
||||||
pkgSrc = src;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue