mirror of
https://github.com/nix-community/home-manager
synced 2024-11-01 08:49:44 +01:00
cf111d1a84
This commit changes the way aliases are rendered, adding the "no more flags" flag `--`, which means that, for example, the alias `"-" = "cd -";` will work as expected. (I was getting a syntax error before this change.) Additionally, now the alias key is shell escaped, which may help some edge cases. I'm honestly not sure if this part is necessary since I assume an alias can't contain spaces anyway, but it definitely shouldn't break anything.
32 lines
631 B
Nix
32 lines
631 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
programs = {
|
|
zsh.enable = true;
|
|
|
|
pls = {
|
|
enable = true;
|
|
enableAliases = true;
|
|
package = config.lib.test.mkStubPackage { outPath = "@pls@"; };
|
|
};
|
|
};
|
|
|
|
test.stubs = {
|
|
pls = { };
|
|
zsh = { };
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.zshrc
|
|
assertFileContains \
|
|
home-files/.zshrc \
|
|
"alias -- 'ls'='@pls@/bin/pls'"
|
|
assertFileContains \
|
|
home-files/.zshrc \
|
|
"alias -- 'll'='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'"
|
|
'';
|
|
};
|
|
}
|