added installer shell script and additional steps

This commit is contained in:
tumillanino
2025-10-28 22:53:15 +11:00
parent 6f1a6f6efa
commit 27ca5a9426
11 changed files with 644 additions and 0 deletions

65
config/config.go Normal file
View File

@@ -0,0 +1,65 @@
package config
type InstallConfig struct {
Disk string
EnableLUKS bool
Hostname string
Username string
RootPassword string
UserPassword string
Timezone string
Locale string
}
type ArchInstallConfig struct {
Bootloader string `json:"bootloader"`
Kernels []string `json:"kernels"`
Filesystem string `json:"filesystem"`
Disk string `json:"disk"`
Encryption *Encryption `json:"encryption,omitempty"`
Hostname string `json:"hostname"`
Timezone string `json:"timezone"`
Locale string `json:"locale"`
Desktop string `json:"desktop"`
Users []User `json:"users"`
}
type Encryption struct {
Type string `json:"type"`
Password string `json:"password"`
}
type User struct {
Username string `json:"username"`
Password string `json:"password"`
Sudo bool `json:"sudo"`
}
func (c *InstallConfig) ToArchInstall() *ArchInstallConfig {
ac := &ArchInstallConfig{
Bootloader: "systemd-boot",
Kernels: []string{"linux-hardened"},
Filesystem: "btrfs",
Disk: c.Disk,
Hostname: c.Hostname,
Timezone: c.Timezone,
Locale: c.Locale,
Desktop: "cosmic",
Users: []User{
{
Username: c.Username,
Password: c.UserPassword,
Sudo: true,
},
},
}
if c.EnableLUKS {
ac.Encryption = &Encryption{
Type: "luks2",
Password: c.RootPassword,
}
}
return ac
}