1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 03:39:47 +01:00
home-manager/modules/programs/granted.nix
Willi Carlsen 454e8d6b15
granted: use assume directly
The `.assume-wrapped` path is not available since the merge of

    https://github.com/NixOS/nixpkgs/pull/347816

Use assume directly instead.

PR #5994
2024-10-25 09:42:19 +02:00

36 lines
708 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 "$@"
unset GRANTED_ALIAS_CONFIGURED
}
'';
};
}