nix-init: add module (#6864)

Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
This commit is contained in:
awwpotato 2025-04-21 10:25:56 -07:00 committed by GitHub
parent 08b85bd000
commit be4e5ec62c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1,40 @@
{ 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"
''}
'';
}

View file

@ -0,0 +1,3 @@
{
nix-init-basic-config = ./basic-config.nix;
}