go: add telemetry options
This commit is contained in:
parent
fcc4259cdb
commit
54b330ac06
4 changed files with 66 additions and 0 deletions
1
tests/modules/programs/go/default.nix
Normal file
1
tests/modules/programs/go/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ go-telemetry = ./go-telemetry.nix; }
|
||||
25
tests/modules/programs/go/go-telemetry.nix
Normal file
25
tests/modules/programs/go/go-telemetry.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.go = {
|
||||
enable = true;
|
||||
telemetry = {
|
||||
mode = "on";
|
||||
date = "2006-01-02";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.go = { };
|
||||
|
||||
nm.script = let
|
||||
modeFileDir = if !pkgs.stdenv.isDarwin then
|
||||
".config/go/telemetry"
|
||||
else
|
||||
"Library/Application Support/go/telemetry";
|
||||
in ''
|
||||
assertFileExists "home-files/${modeFileDir}/mode"
|
||||
assertFileContent \
|
||||
"home-files/${modeFileDir}/mode" \
|
||||
"on 2006-01-02"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue