go: add telemetry options

This commit is contained in:
Hoang Nguyen 2024-10-26 00:00:00 +07:00 committed by Sumner Evans
parent fcc4259cdb
commit 54b330ac06
No known key found for this signature in database
4 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1 @@
{ go-telemetry = ./go-telemetry.nix; }

View 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"
'';
}