This commit is contained in:
@@ -7,30 +7,30 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type InstallConfig struct {
|
type InstallConfig struct {
|
||||||
Disk string
|
Disk string
|
||||||
EnableLUKS bool
|
EnableLUKS bool
|
||||||
Hostname string
|
Hostname string
|
||||||
Username string
|
Username string
|
||||||
RootPassword string
|
RootPassword string
|
||||||
UserPassword string
|
UserPassword string
|
||||||
Timezone string
|
Timezone string
|
||||||
Locale string
|
Locale string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArchInstallConfig struct {
|
type ArchInstallConfig struct {
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Script string `json:"script"`
|
Script string `json:"script"`
|
||||||
ArchinstallLanguage string `json:"archinstall-language"`
|
ArchinstallLanguage string `json:"archinstall-language"`
|
||||||
Bootloader string `json:"bootloader"`
|
Bootloader string `json:"bootloader"`
|
||||||
Kernels []string `json:"kernels"`
|
Kernels []string `json:"kernels"`
|
||||||
Hostname string `json:"hostname"`
|
Hostname string `json:"hostname"`
|
||||||
Timezone string `json:"timezone"`
|
Timezone string `json:"timezone"`
|
||||||
LocaleConfig LocaleConfig `json:"locale_config"`
|
LocaleConfig LocaleConfig `json:"locale_config"`
|
||||||
DiskConfig DiskConfig `json:"disk_config"`
|
DiskConfig DiskConfig `json:"disk_config"`
|
||||||
ProfileConfig ProfileConfig `json:"profile_config"`
|
ProfileConfig ProfileConfig `json:"profile_config"`
|
||||||
AuthConfig AuthConfig `json:"auth_config"`
|
AuthConfig AuthConfig `json:"auth_config"`
|
||||||
Packages []string `json:"packages"`
|
Packages []string `json:"packages"`
|
||||||
Services []string `json:"services"`
|
Services []string `json:"services"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LocaleConfig struct {
|
type LocaleConfig struct {
|
||||||
@@ -40,14 +40,14 @@ type LocaleConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DiskConfig struct {
|
type DiskConfig struct {
|
||||||
ConfigType string `json:"config_type"`
|
ConfigType string `json:"config_type"`
|
||||||
DeviceModifications []DeviceModification `json:"device_modifications"`
|
DeviceModifications []DeviceModification `json:"device_modifications"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeviceModification struct {
|
type DeviceModification struct {
|
||||||
Device string `json:"device"`
|
Device string `json:"device"`
|
||||||
Partitions []Partition `json:"partitions"`
|
Partitions []Partition `json:"partitions"`
|
||||||
Wipe bool `json:"wipe"`
|
Wipe bool `json:"wipe"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Partition struct {
|
type Partition struct {
|
||||||
@@ -145,7 +145,6 @@ func (c *InstallConfig) ToArchInstall() *ArchInstallConfig {
|
|||||||
"firejail",
|
"firejail",
|
||||||
"apparmor",
|
"apparmor",
|
||||||
"nftables", // Using nftables instead of ufw as requested
|
"nftables", // Using nftables instead of ufw as requested
|
||||||
"hardened-malloc",
|
|
||||||
|
|
||||||
// Browsers
|
// Browsers
|
||||||
"chromium", // Using regular chromium instead of ungoogled-chromium as requested
|
"chromium", // Using regular chromium instead of ungoogled-chromium as requested
|
||||||
@@ -220,7 +219,7 @@ func (c *InstallConfig) SaveArchInstallConfig(filepath string) error {
|
|||||||
return fmt.Errorf("failed to marshal config: %w", err)
|
return fmt.Errorf("failed to marshal config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return os.WriteFile(filepath, data, 0644)
|
return os.WriteFile(filepath, data, 0o644)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *InstallConfig) SaveUserCredentials(filepath string) error {
|
func (c *InstallConfig) SaveUserCredentials(filepath string) error {
|
||||||
@@ -247,5 +246,5 @@ func (c *InstallConfig) SaveUserCredentials(filepath string) error {
|
|||||||
return fmt.Errorf("failed to marshal credentials: %w", err)
|
return fmt.Errorf("failed to marshal credentials: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return os.WriteFile(filepath, data, 0600)
|
return os.WriteFile(filepath, data, 0o600)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user