nix-init: add module (#6864)
Co-authored-by: uncenter <47499684+uncenter@users.noreply.github.com>
This commit is contained in:
parent
08b85bd000
commit
be4e5ec62c
7 changed files with 115 additions and 0 deletions
40
tests/modules/programs/nix-init/basic-config.nix
Normal file
40
tests/modules/programs/nix-init/basic-config.nix
Normal 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"
|
||||
''}
|
||||
'';
|
||||
}
|
||||
3
tests/modules/programs/nix-init/default.nix
Normal file
3
tests/modules/programs/nix-init/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
nix-init-basic-config = ./basic-config.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue