1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 10:19:39 +01:00
home-manager/tests/modules/programs/nix-init/basic-config.nix
awwpotato be4e5ec62c
nix-init: add module (#6864)
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
2025-04-21 12:25:56 -05:00

40 lines
992 B
Nix

{ pkgs, ... }:
{
programs.nix-init = {
enable = true;
settings = {
maintainers = [ "figsoda" ];
nixpkgs = "<nixpkgs>";
commit = true;
access-tokens = {
"github.com" = "ghp_blahblahblah...";
"gitlab.com".command = [
"secret-tool"
"or"
"whatever"
"you"
"use"
];
"gitlab.gnome.org".file = "/path/to/api/token";
};
};
};
nmt.script = ''
assertFileExists home-files/.config/nix-init/config.toml
assertFileContent home-files/.config/nix-init/config.toml \
${pkgs.writeText "settings-expected" ''
commit = true
maintainers = ["figsoda"]
nixpkgs = "<nixpkgs>"
[access-tokens]
"github.com" = "ghp_blahblahblah..."
[access-tokens."gitlab.com"]
command = ["secret-tool", "or", "whatever", "you", "use"]
[access-tokens."gitlab.gnome.org"]
file = "/path/to/api/token"
''}
'';
}