Store your Minecraft configs with your other dotfiles, and load it automatically.

init: get started, basic basic config loading

Changed files
+49
config
+3
config.toml
··· 1 + [fabric.mods] 2 + sodium = "AANobbMI" 3 + fabric-api = "P7dR8mSH"
+23
config/config.go
··· 1 + package config 2 + 3 + import ( 4 + "os" 5 + 6 + "github.com/BurntSushi/toml" 7 + ) 8 + 9 + type ( 10 + Config struct { 11 + Fabric Loader `toml:fabric` 12 + } 13 + Loader struct { 14 + Mods map[string]string `toml:mods` 15 + } 16 + ) 17 + 18 + func LoadConfig() (Config) { 19 + file, _ := os.ReadFile("config.toml") 20 + var config Config 21 + toml.Decode(string(file), &config) 22 + return config 23 + }
+5
go.mod
··· 1 + module potassium.sh/dot-mining 2 + 3 + go 1.25.4 4 + 5 + require github.com/BurntSushi/toml v1.5.0 // indirect
+2
go.sum
··· 1 + github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= 2 + github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
+16
main.go
··· 1 + package main 2 + 3 + import ( 4 + "fmt" 5 + 6 + "potassium.sh/dot-mining/config" 7 + ) 8 + 9 + 10 + 11 + func main() { 12 + config := config.LoadConfig() 13 + for modName, modID := range config.Fabric.Mods { 14 + fmt.Printf("- %s: %s\n", modName, modID) 15 + } 16 + }