cargo: add package option
This commit is contained in:
parent
bd9f031efc
commit
fdafcac367
1 changed files with 5 additions and 4 deletions
|
|
@ -5,10 +5,7 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption;
|
||||
|
||||
tomlFormat = pkgs.formats.toml { };
|
||||
|
||||
cfg = config.programs.cargo;
|
||||
in
|
||||
{
|
||||
|
|
@ -17,7 +14,9 @@ in
|
|||
options = {
|
||||
programs = {
|
||||
cargo = {
|
||||
enable = mkEnableOption "management of cargo config";
|
||||
enable = lib.mkEnableOption "management of cargo config";
|
||||
|
||||
package = lib.mkPackageOption pkgs "cargo" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
|
|
@ -33,6 +32,8 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
file = {
|
||||
".cargo/config.toml" = {
|
||||
source = tomlFormat.generate "config.toml" cfg.settings;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue