[feat] scripts: import audiomenu and RiiR
This commit is contained in:
parent
ac41d8527f
commit
82b37311a9
7 changed files with 945 additions and 28 deletions
40
scripts/audiomenu/package.nix
Normal file
40
scripts/audiomenu/package.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ lib, rustPlatform }:
|
||||
let
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
inherit (cargoToml.package) name version description;
|
||||
pname = name;
|
||||
src = lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
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
|
||||
type == "directory" || matchesSuffix || isCargoLock || isOldStyleCargoConfig;
|
||||
};
|
||||
in
|
||||
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/configuration.nix";
|
||||
mainProgram = name;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue