1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-01 06:31:04 +01:00
home-manager/tests/modules/programs/sapling/sapling-most.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

49 lines
1 KiB
Nix

{ pkgs, ... }:
{
programs.sapling = {
enable = true;
userName = "John Doe";
userEmail = "johndoe@example.com";
aliases = {
cm = "commit";
d = "diff --exclude=*.lock";
s = "status";
view = "!$HG config paths.default | xargs open";
};
extraConfig = {
pager.pager = "delta";
gpg.key = "not-an-actual-key";
};
};
nmt.script =
let
configfile =
if pkgs.stdenv.isDarwin then
"Library/Preferences/sapling/sapling.conf"
else
".config/sapling/sapling.conf";
expected = builtins.toFile "sapling.conf" ''
[alias]
cm=commit
d=diff --exclude=*.lock
s=status
view=!$HG config paths.default | xargs open
[gpg]
key=not-an-actual-key
[pager]
pager=delta
[ui]
username=John Doe <johndoe@example.com>
'';
in
''
assertFileExists home-files/${configfile}
assertFileContent home-files/${configfile} ${expected}
'';
}