refactor(flake): Now produces two packages based on enabled features

This commit is contained in:
GaspardCulis 2025-02-05 15:15:29 +01:00
parent 014c4f88a1
commit a833fe8e20
2 changed files with 3 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> { } }:
{ pkgs ? import <nixpkgs> { }, features ? [ ] }:
let manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
in
pkgs.rustPlatform.buildRustPackage {
@ -7,7 +7,7 @@ pkgs.rustPlatform.buildRustPackage {
src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
buildFeatures = [ "lolcat" ];
buildFeatures = features;
nativeBuildInputs = [
pkgs.pkg-config

View file

@ -11,6 +11,7 @@
in {
packages = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./. { };
lolcat = pkgsFor.${system}.callPackage ./. { features = [ "lolcat" ]; };
});
};
}