granted: add module

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
This commit is contained in:
Willi Carlsen 2023-10-24 15:49:09 +02:00 committed by Robert Helgesson
parent a421804890
commit 48b0a30202
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{
granted-integration-enabled = ./integration-enabled.nix;
granted-integration-disabled = ./integration-disabled.nix;
}

View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
programs = {
granted.enable = true;
granted.enableZshIntegration = false;
zsh.enable = true;
};
test.stubs.granted = { };
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileNotRegex \
home-files/.zshrc \
'function assume()'
assertFileNotRegex \
home-files/.zshrc \
'export GRANTED_ALIAS_CONFIGURED="true"'
assertFileNotRegex \
home-files/.zshrc \
'source @granted@/bin/.assume-wrapped "$@"'
assertFileNotRegex \
home-files/.zshrc \
'unset GRANTED_ALIAS_CONFIGURED'
'';
}

View file

@ -0,0 +1,26 @@
{ pkgs, ... }:
{
programs = {
granted.enable = true;
zsh.enable = true;
};
test.stubs.granted = { };
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileContains \
home-files/.zshrc \
'function assume()'
assertFileContains \
home-files/.zshrc \
'export GRANTED_ALIAS_CONFIGURED="true"'
assertFileContains \
home-files/.zshrc \
'source @granted@/bin/.assume-wrapped "$@"'
assertFileContains \
home-files/.zshrc \
'unset GRANTED_ALIAS_CONFIGURED'
'';
}