2.home-manager/tests/modules/programs/nix-init/basic-config.nix
Austin Horstman 1e313820a3 treewide: adapt toml generator changes
Upstream formatter change in
https://github.com/NixOS/nixpkgs/pull/512319 caused tests to fail.
2026-05-02 20:19:12 -05:00

41 lines
1,015 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'
''}
'';
}