fix(fmt): use nixfmt-rfc-style
This commit is contained in:
parent
9fc79a0c7b
commit
144d5c45c6
4 changed files with 139 additions and 112 deletions
55
default.nix
55
default.nix
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
readToml = path: builtins.fromTOML (builtins.readFile path);
|
||||
cargoToml = readToml ./Cargo.toml;
|
||||
pname = cargoToml.package.name;
|
||||
|
@ -11,32 +12,34 @@
|
|||
name = "${pname}-source";
|
||||
# Adapted from <https://github.com/ipetkov/crane/blob/master/lib/filterCargoSources.nix>
|
||||
# no need to pull in crane for just this
|
||||
filter = orig_path: type: let
|
||||
path = toString orig_path;
|
||||
base = baseNameOf path;
|
||||
parentDir = baseNameOf (dirOf path);
|
||||
matchesSuffix = lib.any (suffix: lib.hasSuffix suffix base) [
|
||||
# Rust sources
|
||||
".rs"
|
||||
# TOML files are often used to configure cargo based tools (e.g. .cargo/config.toml)
|
||||
".toml"
|
||||
];
|
||||
isCargoLock = base == "Cargo.lock";
|
||||
# .cargo/config.toml is captured above
|
||||
isOldStyleCargoConfig = parentDir == ".cargo" && base == "config";
|
||||
in
|
||||
filter =
|
||||
orig_path: type:
|
||||
let
|
||||
path = toString orig_path;
|
||||
base = baseNameOf path;
|
||||
parentDir = baseNameOf (dirOf path);
|
||||
matchesSuffix = lib.any (suffix: lib.hasSuffix suffix base) [
|
||||
# Rust sources
|
||||
".rs"
|
||||
# TOML files are often used to configure cargo based tools (e.g. .cargo/config.toml)
|
||||
".toml"
|
||||
];
|
||||
isCargoLock = base == "Cargo.lock";
|
||||
# .cargo/config.toml is captured above
|
||||
isOldStyleCargoConfig = parentDir == ".cargo" && base == "config";
|
||||
in
|
||||
type == "directory" || matchesSuffix || isCargoLock || isOldStyleCargoConfig;
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
useNextest = true;
|
||||
rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
useNextest = true;
|
||||
|
||||
meta = {
|
||||
inherit description;
|
||||
license = lib.licenses.mit;
|
||||
homepage = "https://github.com/jalil-salame/webnsupdate";
|
||||
mainProgram = "webnsupdate";
|
||||
};
|
||||
}
|
||||
meta = {
|
||||
inherit description;
|
||||
license = lib.licenses.mit;
|
||||
homepage = "https://github.com/jalil-salame/webnsupdate";
|
||||
mainProgram = "webnsupdate";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue