mirror of
https://github.com/nix-community/nurl.git
synced 2024-09-11 10:10:39 +03:00
flake: clean up
This commit is contained in:
parent
837d29a7cf
commit
23b36061c8
56
flake.nix
56
flake.nix
@ -5,30 +5,38 @@
|
|||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs }:
|
||||||
let
|
let
|
||||||
inherit (builtins) path;
|
|
||||||
inherit (nixpkgs.lib)
|
inherit (nixpkgs.lib)
|
||||||
genAttrs importTOML licenses makeBinPath maintainers optionals sourceByRegex;
|
genAttrs
|
||||||
|
importTOML
|
||||||
|
licenses
|
||||||
|
maintainers
|
||||||
|
makeBinPath
|
||||||
|
optionals
|
||||||
|
sourceByRegex
|
||||||
|
;
|
||||||
|
|
||||||
inherit (importTOML (self + "/Cargo.toml")) package;
|
inherit (importTOML (self + "/Cargo.toml")) package;
|
||||||
|
|
||||||
forEachSystem = genAttrs [
|
eachSystem = f: genAttrs
|
||||||
"aarch64-darwin"
|
[
|
||||||
"aarch64-linux"
|
"aarch64-darwin"
|
||||||
"x86_64-darwin"
|
"aarch64-linux"
|
||||||
"x86_64-linux"
|
"x86_64-darwin"
|
||||||
];
|
"x86_64-linux"
|
||||||
|
]
|
||||||
|
(system: f nixpkgs.legacyPackages.${system});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter = forEachSystem
|
formatter = eachSystem (pkgs: pkgs.nixpkgs-fmt);
|
||||||
(system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);
|
|
||||||
|
|
||||||
herculesCI.ciSystems = [
|
herculesCI.ciSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = forEachSystem (system:
|
packages = eachSystem (pkgs:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs.legacyPackages.${system})
|
inherit (pkgs)
|
||||||
darwin
|
darwin
|
||||||
gitMinimal
|
gitMinimal
|
||||||
installShellFiles
|
installShellFiles
|
||||||
@ -38,23 +46,23 @@
|
|||||||
rustPlatform
|
rustPlatform
|
||||||
stdenv
|
stdenv
|
||||||
;
|
;
|
||||||
|
|
||||||
|
src = sourceByRegex self [
|
||||||
|
"(src|tests)(/.*)?"
|
||||||
|
"Cargo\\.(toml|lock)"
|
||||||
|
"build.rs"
|
||||||
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = rustPlatform.buildRustPackage {
|
default = rustPlatform.buildRustPackage {
|
||||||
pname = "nurl";
|
pname = "nurl";
|
||||||
inherit (package) version;
|
inherit (package) version;
|
||||||
|
|
||||||
src = sourceByRegex self [
|
inherit src;
|
||||||
"(src|tests)(/.*)?"
|
|
||||||
"Cargo\\.(toml|lock)"
|
|
||||||
"build.rs"
|
|
||||||
];
|
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
allowBuiltinFetchGit = true;
|
allowBuiltinFetchGit = true;
|
||||||
lockFile = path {
|
lockFile = src + "/Cargo.lock";
|
||||||
path = self + "/Cargo.lock";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@ -69,6 +77,10 @@
|
|||||||
# tests require internet access
|
# tests require internet access
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
env = {
|
||||||
|
GEN_ARTIFACTS = "artifacts";
|
||||||
|
};
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/nurl \
|
wrapProgram $out/bin/nurl \
|
||||||
--prefix PATH : ${makeBinPath [ gitMinimal mercurial nixVersions.unstable ]}
|
--prefix PATH : ${makeBinPath [ gitMinimal mercurial nixVersions.unstable ]}
|
||||||
@ -76,10 +88,6 @@
|
|||||||
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
|
installShellCompletion artifacts/nurl.{bash,fish} --zsh artifacts/_nurl
|
||||||
'';
|
'';
|
||||||
|
|
||||||
env = {
|
|
||||||
GEN_ARTIFACTS = "artifacts";
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
inherit (package) description;
|
inherit (package) description;
|
||||||
license = licenses.mpl20;
|
license = licenses.mpl20;
|
||||||
|
Loading…
Reference in New Issue
Block a user