4.flake-parts/modules/devShells.nix
2025-11-29 12:02:24 +01:00

38 lines
1,015 B
Nix

{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
types
literalExpression
;
inherit (flake-parts-lib)
mkTransposedPerSystemModule
;
in
mkTransposedPerSystemModule {
name = "devShells";
option = mkOption {
type = types.lazyAttrsOf types.package;
default = { };
description = ''
An attribute set of packages to be used as shells.
[`nix develop .#<name>`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html) will run `devShells.<name>`.
Attribute names containing special characters like `.` must be doubly quoted when used in installable arguments:
```bash
nix develop '.#"example.com"'
```
Consider using `:` or `/` as separators instead (e.g., `foo:bar`) for better command-line usability.
'';
example = literalExpression ''
{
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ wget bat cargo ];
};
}
'';
};
file = ./devShells.nix;
}