1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-15 07:39:46 +01:00
home-manager/tests/modules/programs/sapling/sapling-basic.nix
Pierce Bartine a842f812ef
sapling: add module
Adds a program module for [Sapling](https://sapling-scm.com/).

Since Sapling itself is very similar in nature to Mercurial,
`modules/programs/mercurial.nix` was copied to make this module with
the ignore pieces removed (Sapling respects gitignore).
2024-04-10 21:26:58 +02:00

26 lines
558 B
Nix

{ pkgs, ... }:
{
programs.sapling = {
enable = true;
userName = "John Doe";
userEmail = "johndoe@example.com";
};
test.stubs.sapling = { };
nmt.script = let
configfile = if pkgs.stdenv.isDarwin then
"Library/Preferences/sapling/sapling.conf"
else
".config/sapling/sapling.conf";
expected = builtins.toFile "sapling.conf" ''
[ui]
username=John Doe <johndoe@example.com>
'';
in ''
assertFileExists home-files/${configfile}
assertFileContent home-files/${configfile} ${expected}
'';
}