-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up Nix Flake and packaging (#24)
* refactor(nix): split package.nix from flake.nix * chore(nix): split checks; add more * ci: run all nix checks * ci: build in debug mode * chore(nix): use versionCheckHook this makes sure the version test is always run, and on the right package * chore(nix): nix-filter -> lib.fileset * feat(nix): support stable nix * ci: fix clippy check
- Loading branch information
Showing
7 changed files
with
132 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
pkgs ? import nixpkgs { | ||
inherit system; | ||
config = { }; | ||
overlays = [ ]; | ||
}, | ||
lib ? pkgs.lib, | ||
nixpkgs ? <nixpkgs>, | ||
system ? builtins.currentSystem, | ||
}: | ||
|
||
let | ||
nixForecastPackages = lib.makeScope pkgs.newScope (lib.flip (import ./overlay.nix) pkgs); | ||
in | ||
{ | ||
inherit (nixForecastPackages) nix-forecast; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
lib, | ||
installShellFiles, | ||
makeBinaryWrapper, | ||
nix, | ||
rustPlatform, | ||
versionCheckHook, | ||
}: | ||
|
||
let | ||
fs = lib.fileset; | ||
in | ||
rustPlatform.buildRustPackage rec { | ||
pname = "nix-forecast"; | ||
inherit (passthru.cargoTOML.package) version; | ||
|
||
src = fs.toSource { | ||
root = ../.; | ||
fileset = fs.intersection (fs.gitTracked ../.) ( | ||
fs.unions [ | ||
../Cargo.lock | ||
../Cargo.toml | ||
../build.rs | ||
../src | ||
] | ||
); | ||
}; | ||
|
||
cargoLock.lockFile = ../Cargo.lock; | ||
|
||
nativeBuildInputs = [ | ||
installShellFiles | ||
makeBinaryWrapper | ||
]; | ||
|
||
doInstallCheck = true; | ||
nativeInstallCheckInputs = [ versionCheckHook ]; | ||
|
||
postInstall = '' | ||
wrapProgram $out/bin/nix-forecast --suffix PATH : ${lib.makeBinPath [ nix ]} | ||
installShellCompletion --cmd nix-forecast \ | ||
--bash completions/nix-forecast.bash \ | ||
--fish completions/nix-forecast.fish \ | ||
--zsh completions/_nix-forecast | ||
''; | ||
|
||
env = { | ||
COMPLETION_DIR = "completions"; | ||
}; | ||
|
||
passthru = { | ||
cargoTOML = lib.importTOML ../Cargo.toml; | ||
}; | ||
|
||
meta = { | ||
description = "Check the forecast for today's Nix builds"; | ||
homepage = "https://github.com/getchoo/nix-forecast"; | ||
changelog = "https://github.com/getchoo/nix-forecast/releases/tag/${version}"; | ||
license = lib.licenses.mpl20; | ||
maintainers = with lib.maintainers; [ getchoo ]; | ||
mainProgram = "nix-forecast"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
final: _: { | ||
nix-forecast = final.callPackage ./nix/package.nix { }; | ||
} |