Removed the `lib.nix` file and refactored various modules to utilize `inputs.self.lib` for user package and attribute management. This change enhances consistency and maintainability across the configuration files.
35 lines
757 B
Nix
35 lines
757 B
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
packages = builtins.attrValues {
|
|
inherit (pkgs)
|
|
zig # Zig compiler and stdlib
|
|
zls # Language server for Zig
|
|
;
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
my.dev.zig.enable = lib.mkEnableOption "Install Zig tooling globally";
|
|
devShells.zig = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.mkShell {
|
|
inherit packages;
|
|
name = "zig-dev-shell";
|
|
shellHook = ''
|
|
echo "🦎 Zig dev environment"
|
|
'';
|
|
};
|
|
description = "Zig development shell with compiler and LSP";
|
|
};
|
|
};
|
|
config = lib.mkIf config.my.dev.zig.enable {
|
|
users.users = inputs.self.lib.mkUserAttrs lib config.my.toggleUsers.dev { inherit packages; };
|
|
};
|
|
}
|