c6444ecc3c
GitOrigin-RevId: 51e44a13acea71b36245e8bd8c7db53e0a3e61ee
36 lines
717 B
Nix
36 lines
717 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.granted;
|
|
package = pkgs.granted;
|
|
|
|
in {
|
|
meta.maintainers = [ hm.maintainers.wcarlsen ];
|
|
|
|
options.programs.granted = {
|
|
enable = mkEnableOption "granted";
|
|
|
|
enableZshIntegration = mkOption {
|
|
default = true;
|
|
type = types.bool;
|
|
description = ''
|
|
Whether to enable Zsh integration.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ package ];
|
|
|
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
|
|
function assume() {
|
|
export GRANTED_ALIAS_CONFIGURED="true"
|
|
source ${package}/bin/.assume-wrapped "$@"
|
|
unset GRANTED_ALIAS_CONFIGURED
|
|
}
|
|
'';
|
|
};
|
|
}
|