1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-21 09:49:39 +01:00
home-manager/modules/programs/ion.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

57 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkOption types;
cfg = config.programs.ion;
aliasesStr = lib.concatStringsSep "\n" (
lib.mapAttrsToList (k: v: "alias ${k} = ${lib.escapeShellArg v}") cfg.shellAliases
);
in
{
meta.maintainers = [ lib.maintainers.jo1gi ];
options.programs.ion = {
enable = lib.mkEnableOption "the Ion Shell. Compatible with Redox and Linux";
package = lib.mkPackageOption pkgs "ion" { };
initExtra = mkOption {
type = types.lines;
default = "";
description = ''
Ion script which is called during ion initialization.
'';
};
shellAliases = mkOption {
type = with types; attrsOf str;
default = { };
example = lib.literalExpression ''
{
g = "git";
}
'';
description = ''
An attribute set that maps aliases (the top level attribute names
in this option) to command strings or directly to build outputs.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."ion/initrc".text = ''
# Aliases
${aliasesStr}
${cfg.initExtra}
'';
};
}