Add cargo module
This commit is contained in:
parent
1e37ae613d
commit
913f94af3c
1 changed files with 27 additions and 0 deletions
27
home-manager/modules/cargo/default.nix
Normal file
27
home-manager/modules/cargo/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue