Initial commit

This commit is contained in:
eleksir
2026-04-02 23:56:28 +03:00
commit 9e30243533
34 changed files with 8413 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//go:build linux
// @tag config
// @tag platform:linux
package config
import (
"os"
"path/filepath"
)
// DefaultConfigPaths returns the config file search paths for Linux.
// Root user: only /etc/pekoe/config.json
// Regular user: ~/.pekoe.json, then /etc/pekoe/config.json
func DefaultConfigPaths() []string {
if os.Getuid() == 0 {
return []string{"/etc/pekoe/config.json"}
}
home, err := os.UserHomeDir()
if err != nil {
return []string{"/etc/pekoe/config.json"}
}
return []string{
filepath.Join(home, ".pekoe.json"),
"/etc/pekoe/config.json",
}
}