alqueva/hosts/shared/nushell.nix

34 lines
700 B
Nix
Raw Permalink Normal View History

{
lib,
pkgs,
config,
...
}:
let
2025-03-22 17:36:40 +00:00
inherit (lib.options) mkOption mkPackageOption mkEnableOption;
inherit (lib.modules) mkIf;
2025-03-22 17:36:40 +00:00
inherit (lib.types) nullOr str;
cfg = config.alqueva.shells.nushell;
in
{
options.alqueva.shells.nushell = {
2025-03-22 17:36:40 +00:00
enable = mkEnableOption "Nushell";
package = mkPackageOption pkgs "nushell" { };
config = mkOption {
type = nullOr str;
default = null;
description = "Nushell code to load by default with Nushell.";
};
};
2025-03-22 17:36:40 +00:00
config = mkIf cfg.enable {
environment = {
systemPackages = [ cfg.package ];
shells = [
(lib.getExe' cfg.package "nu")
"/run/current-system/sw/bin/nu"
];
};
};
}