mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
454e8d6b15
The `.assume-wrapped` path is not available since the merge of https://github.com/NixOS/nixpkgs/pull/347816 Use assume directly instead. PR #5994
36 lines
708 B
Nix
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
|
|
}
|
|
'';
|
|
};
|
|
}
|