feat: rewrite audiomenu in Python
Some checks failed
/ check (push) Successful in 9s
/ build-packages (push) Failing after 15s
/ build-vm (push) Has been skipped
/ report-size (push) Has been skipped

There is no reason for it to be a Rust program
This commit is contained in:
Jalil David Salamé Messina 2025-05-17 14:13:57 +02:00
parent c65e793a85
commit 66cd7b90b6
Signed by: jalil
GPG key ID: F016B9E770737A0B
12 changed files with 290 additions and 857 deletions

View file

@ -1,38 +1,7 @@
{ lib, ... }:
let
# Clean the package source leaving only the relevant rust files
cleanRustSrc =
pname: src:
lib.cleanSourceWith {
inherit 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_str = toString orig_path;
base = baseNameOf path_str;
parentDir = baseNameOf (dirOf path_str);
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;
};
# callPackage but for my rust Packages
callRustPackage =
pkgs: pname: nixSrc:
pkgs.callPackage nixSrc { cleanRustSrc = cleanRustSrc pname; };
packages = pkgs: {
jpassmenu = pkgs.callPackage ./jpassmenu/package.nix { };
audiomenu = callRustPackage pkgs "audiomenu" ./audiomenu/package.nix;
audiomenu = pkgs.callPackage ./audiomenu/package.nix { };
};
in
{