nixos-config/home-manager/modules/cargo/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

30 lines
624 B
Nix

{
pkgs,
config,
lib,
...
}:
with lib;
let
cfg = config.eboskma.programs.cargo;
tomlFormat = pkgs.formats.toml { };
cargoConfig = types.submodule { freeformType = tomlFormat.type; };
in
{
options.eboskma.programs.cargo = {
enable = mkEnableOption "cargo";
settings = mkOption {
description = "Cargo configuration according to https://doc.rust-lang.org/cargo/reference/config.html";
default = { };
type = cargoConfig;
};
};
config = mkIf cfg.enable {
home.file.".cargo/config.toml" = {
source = tomlFormat.generate "cargo-config.toml" cfg.settings;
};
};
}