Skip to content

Commit fa5ae2e

Browse files
committed
fix: make devshell category configurable
1 parent 22d988e commit fa5ae2e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

nix/public-flake-module.nix

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,14 @@ ourArgs:
138138
}
139139
'';
140140
};
141-
devshell = lib.mkOption {
141+
devshell.name = lib.mkOption {
142+
type = types.nullOr types.str;
143+
default = null;
144+
description = ''
145+
Name of devshell to add update-cargo-nix command to.
146+
'';
147+
};
148+
devshell.category = lib.mkOption {
142149
type = types.nullOr types.str;
143150
default = null;
144151
description = ''
@@ -163,10 +170,10 @@ ourArgs:
163170
config = lib.mkMerge [
164171
(lib.mkIf (options ? devshells && cfg.devshell != null) (
165172
(lib.optionalAttrs (options ? devshells) {
166-
devshells.${cfg.devshell} = {
173+
devshells.${cfg.devshell.name} = {
167174
commands = [
168175
{
169-
category = "development";
176+
category = lib.mkIf (cfg.devshell.category != null) cfg.devshell.category;
170177
name = "update-cargo-nix";
171178
help = "Update Cargo.nix";
172179
command = "${lib.getExe crate2nix} generate";

0 commit comments

Comments
 (0)