feat(branding): professionalize installer and system branding
- Refactor installer with Gum for a professional interactive experience - Create custom Nomarchy Plymouth theme with centered logo - Establish assets/branding directory for official logos and ASCII art - Update Fastfetch config with official ASCII art and declarative stats - Declaratively link branding assets via Home Manager
This commit is contained in:
BIN
assets/branding/logo.png
Normal file
BIN
assets/branding/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
26
assets/branding/logo.txt
Normal file
26
assets/branding/logo.txt
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
██████████████████████████████████████████████████████
|
||||||
|
██████████████████████████████████████████████████████
|
||||||
|
████ ████ ████
|
||||||
|
████ ████ ████
|
||||||
|
████ █████████████████████ ████████ ████
|
||||||
|
████ █████████████████████ ████████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████████████ ████ ████
|
||||||
|
████████████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ████ ████ ████
|
||||||
|
████ ██████████████████████████████████████ ████
|
||||||
|
████ ██████████████████████████████████████ ████
|
||||||
|
████ ████ ████
|
||||||
|
████ ████ ████
|
||||||
|
█████████████████████████████ ████████████████████
|
||||||
|
█████████████████████████████ ████████████████████
|
||||||
BIN
assets/plymouth/logo.png
Normal file
BIN
assets/plymouth/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
8
assets/plymouth/nomarchy.plymouth
Normal file
8
assets/plymouth/nomarchy.plymouth
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[Plymouth Theme]
|
||||||
|
Name=Nomarchy
|
||||||
|
Description=Nomarchy boot splash theme
|
||||||
|
ModuleName=script
|
||||||
|
|
||||||
|
[script]
|
||||||
|
ImageDir=/etc/plymouth/themes/nomarchy
|
||||||
|
ScriptFile=/etc/plymouth/themes/nomarchy/nomarchy.script
|
||||||
21
assets/plymouth/nomarchy.script
Normal file
21
assets/plymouth/nomarchy.script
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
logo_image = Image("logo.png");
|
||||||
|
|
||||||
|
screen_width = Window.GetWidth();
|
||||||
|
screen_height = Window.GetHeight();
|
||||||
|
|
||||||
|
logo_width = logo_image.GetWidth();
|
||||||
|
logo_height = logo_image.GetHeight();
|
||||||
|
|
||||||
|
logo_x = screen_width / 2 - logo_width / 2;
|
||||||
|
logo_y = screen_height / 2 - logo_height / 2;
|
||||||
|
|
||||||
|
logo_sprite = Sprite(logo_image);
|
||||||
|
logo_sprite.SetX(logo_x);
|
||||||
|
logo_sprite.SetY(logo_y);
|
||||||
|
logo_sprite.SetOpacity(1);
|
||||||
|
|
||||||
|
fun refresh_callback () {
|
||||||
|
# Simple rotation or pulse could go here
|
||||||
|
}
|
||||||
|
|
||||||
|
Plymouth.SetRefreshFunction (refresh_callback);
|
||||||
@@ -5,6 +5,6 @@
|
|||||||
|
|
||||||
clear
|
clear
|
||||||
echo -e "\033[32m"
|
echo -e "\033[32m"
|
||||||
cat <~/.local/share/nomarchy/logo.txt
|
cat < ~/.config/nomarchy/branding/logo.txt
|
||||||
echo -e "\033[0m"
|
echo -e "\033[0m"
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||||
"logo": {
|
"logo": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "~/.config/nomarchy/branding/about.txt",
|
"source": "~/.config/nomarchy/branding/logo.txt",
|
||||||
"color": { "1": "green" },
|
"color": { "1": "green" },
|
||||||
"padding": {
|
"padding": {
|
||||||
"top": 2,
|
"top": 2,
|
||||||
@@ -63,22 +63,9 @@
|
|||||||
"format": "\u001b[90m┌──────────────────────Software──────────────────────┐"
|
"format": "\u001b[90m┌──────────────────────Software──────────────────────┐"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "os",
|
||||||
"key": "\ue900 OS",
|
"key": "\ue900 OS",
|
||||||
"keyColor": "blue",
|
"keyColor": "blue"
|
||||||
"text": "version=$(nomarchy-version); echo \"Nomarchy $version\""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"key": "│ ├",
|
|
||||||
"keyColor": "blue",
|
|
||||||
"text": "branch=$(nomarchy-version-branch); echo \"$branch\""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"key": "│ ├",
|
|
||||||
"keyColor": "blue",
|
|
||||||
"text": "channel=$(nomarchy-version-channel); echo \"$channel\""
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "kernel",
|
"type": "kernel",
|
||||||
@@ -114,7 +101,7 @@
|
|||||||
"type": "command",
|
"type": "command",
|
||||||
"key": "│ ├",
|
"key": "│ ├",
|
||||||
"keyColor": "blue",
|
"keyColor": "blue",
|
||||||
"text": "theme=$(nomarchy-theme-current); echo -e \"$theme \\e[38m●\\e[37m●\\e[36m●\\e[35m●\\e[34m●\\e[33m●\\e[32m●\\e[31m●\""
|
"text": "theme=$(cat ~/.config/nomarchy/current/theme.name); echo -e \"$theme \\e[38m●\\e[37m●\\e[36m●\\e[35m●\\e[34m●\\e[33m●\\e[32m●\\e[31m●\""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "terminalfont",
|
"type": "terminalfont",
|
||||||
@@ -141,12 +128,6 @@
|
|||||||
"key": " Uptime",
|
"key": " Uptime",
|
||||||
"keyColor": "magenta"
|
"keyColor": "magenta"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"key": " Update",
|
|
||||||
"keyColor": "magenta",
|
|
||||||
"text": "updated=$(nomarchy-version-pkgs); echo \"$updated\""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "custom",
|
"type": "custom",
|
||||||
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
|
"format": "\u001b[90m└────────────────────────────────────────────────────┘"
|
||||||
|
|||||||
@@ -1,11 +1,30 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "Welcome to the Nomarchy - A NixOS-based distribution with Omarchy flavour Installer"
|
# Nomarchy Installer
|
||||||
|
# Professionalized with Gum
|
||||||
|
|
||||||
echo "Checking internet connectivity..."
|
# Function to display stylized headers
|
||||||
|
header() {
|
||||||
|
clear
|
||||||
|
gum style \
|
||||||
|
--foreground 212 --border-foreground 212 --border double \
|
||||||
|
--align center --width 50 --margin "1 2" --padding "2 4" \
|
||||||
|
"NOMARCHY" "The Omarchy-flavored NixOS"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to show a section header
|
||||||
|
section() {
|
||||||
|
echo
|
||||||
|
gum style --foreground 10 --bold "» $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
header
|
||||||
|
|
||||||
|
section "Environment Check"
|
||||||
|
gum spin --spinner dot --title "Verifying internet connection..." -- sleep 1
|
||||||
while ! ping -c 1 8.8.8.8 &> /dev/null; do
|
while ! ping -c 1 8.8.8.8 &> /dev/null; do
|
||||||
echo "Error: No internet connection detected. An active connection is required to install Nomarchy."
|
gum style --foreground 9 "Error: No internet connection detected."
|
||||||
CHOICE=$(gum choose "Open Network Manager (nmtui)" "Retry Connection" "Exit Installer")
|
CHOICE=$(gum choose "Open Network Manager (nmtui)" "Retry Connection" "Exit Installer")
|
||||||
if [ "$CHOICE" = "Open Network Manager (nmtui)" ]; then
|
if [ "$CHOICE" = "Open Network Manager (nmtui)" ]; then
|
||||||
nmtui
|
nmtui
|
||||||
@@ -13,9 +32,8 @@ while ! ping -c 1 8.8.8.8 &> /dev/null; do
|
|||||||
echo "Exiting installer."
|
echo "Exiting installer."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Re-checking internet connectivity..."
|
|
||||||
done
|
done
|
||||||
echo "Internet connection verified."
|
echo "✓ Internet connection verified."
|
||||||
|
|
||||||
# 0. Environment Setup
|
# 0. Environment Setup
|
||||||
NOMARCHY_REPO=""
|
NOMARCHY_REPO=""
|
||||||
@@ -26,36 +44,31 @@ elif [ -d "$(dirname "$0")/.." ] && [ -f "$(dirname "$0")/../flake.nix" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$NOMARCHY_REPO" ]; then
|
if [ -z "$NOMARCHY_REPO" ]; then
|
||||||
echo "Nomarchy repository not found. Please run this script from the repository root or on a Nomarchy live ISO."
|
gum style --foreground 9 "Error: Nomarchy repository not found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 1. Hardware Detection & Mapping
|
# 1. Hardware Detection
|
||||||
|
section "Hardware Detection"
|
||||||
PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null || echo "Unknown")
|
PRODUCT_NAME=$(cat /sys/class/dmi/id/product_name 2>/dev/null || echo "Unknown")
|
||||||
BOARD_NAME=$(cat /sys/class/dmi/id/board_name 2>/dev/null || echo "Unknown")
|
|
||||||
CPU_VENDOR=$(lscpu | grep "Vendor ID" | awk '{print $3}')
|
CPU_VENDOR=$(lscpu | grep "Vendor ID" | awk '{print $3}')
|
||||||
echo "Detected hardware: $PRODUCT_NAME ($BOARD_NAME)"
|
echo "Detected Device: $PRODUCT_NAME"
|
||||||
echo "Detected CPU: $CPU_VENDOR"
|
echo "Detected CPU: $CPU_VENDOR"
|
||||||
|
|
||||||
HARDWARE_MODULES=""
|
HARDWARE_MODULES=""
|
||||||
NOMARCHY_HW_OPTS=""
|
NOMARCHY_HW_OPTS=""
|
||||||
|
|
||||||
# Add generic CPU optimizations
|
|
||||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]]; then
|
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]]; then
|
||||||
HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-amd"
|
HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-amd"
|
||||||
elif [[ "$CPU_VENDOR" == "GenuineIntel" ]]; then
|
elif [[ "$CPU_VENDOR" == "GenuineIntel" ]]; then
|
||||||
HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-intel"
|
HARDWARE_MODULES="inputs.nixos-hardware.nixosModules.common-cpu-intel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Comprehensive Hardware Selection
|
echo "Select your hardware vendor for optimized profiles:"
|
||||||
echo "Searching for optimized hardware profiles..."
|
VENDOR=$(gum choose --header "Hardware Vendor" \
|
||||||
|
|
||||||
echo "Select your hardware vendor/category:"
|
|
||||||
VENDOR=$(gum choose --header "Select Vendor" \
|
|
||||||
"acer" "apple" "asus" "dell" "framework" "google" "hp" "lenovo" "microsoft" "msi" "purism" "samsung" "starlabs" "system76" "toshiba" "None/Generic")
|
"acer" "apple" "asus" "dell" "framework" "google" "hp" "lenovo" "microsoft" "msi" "purism" "samsung" "starlabs" "system76" "toshiba" "None/Generic")
|
||||||
|
|
||||||
if [ "$VENDOR" != "None/Generic" ]; then
|
if [ "$VENDOR" != "None/Generic" ]; then
|
||||||
echo "Select specific model for $VENDOR:"
|
|
||||||
case $VENDOR in
|
case $VENDOR in
|
||||||
dell)
|
dell)
|
||||||
MODEL=$(gum choose "xps-13-9300" "xps-13-9310" "xps-13-9343" "xps-13-9360" "xps-13-9370" "xps-13-9380" "xps-15-7590" "xps-15-9500" "xps-15-9510" "xps-15-9550" "precision-5510" "precision-5530")
|
MODEL=$(gum choose "xps-13-9300" "xps-13-9310" "xps-13-9343" "xps-13-9360" "xps-13-9370" "xps-13-9380" "xps-15-7590" "xps-15-9500" "xps-15-9510" "xps-15-9550" "precision-5510" "precision-5530")
|
||||||
@@ -84,232 +97,160 @@ if [ "$VENDOR" != "None/Generic" ]; then
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Enter the nixos-hardware module path (e.g. inputs.nixos-hardware.nixosModules.common-cpu-amd):"
|
INPUT_MOD=$(gum input --placeholder "Enter nixos-hardware module path")
|
||||||
INPUT_MOD=$(gum input --placeholder "inputs.nixos-hardware.nixosModules.xxx")
|
|
||||||
HARDWARE_MODULES="$HARDWARE_MODULES\n $INPUT_MOD"
|
HARDWARE_MODULES="$HARDWARE_MODULES\n $INPUT_MOD"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2. Storage Setup
|
# 2. Storage Setup
|
||||||
echo "Select the target drive for installation:"
|
section "Storage & Partitioning"
|
||||||
DRIVES=$(lsblk -d -n -p -o NAME,SIZE | grep -v loop)
|
DRIVES=$(lsblk -d -n -p -o NAME,SIZE | grep -v loop)
|
||||||
TARGET_DRIVE=$(echo "$DRIVES" | gum choose | awk '{print $1}')
|
TARGET_DRIVE=$(echo "$DRIVES" | gum choose --header "Select target drive" | awk '{print $1}')
|
||||||
if [ -z "$TARGET_DRIVE" ]; then
|
if [ -z "$TARGET_DRIVE" ]; then exit 1; fi
|
||||||
echo "No drive selected. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Select the partition layout:"
|
|
||||||
LAYOUT=$(gum choose "Standard Ext4" "Encrypted BTRFS (LUKS2)")
|
LAYOUT=$(gum choose "Standard Ext4" "Encrypted BTRFS (LUKS2)")
|
||||||
IMPERMANENCE="No"
|
IMPERMANENCE="No"
|
||||||
if [ "$LAYOUT" = "Standard Ext4" ]; then
|
if [ "$LAYOUT" = "Standard Ext4" ]; then
|
||||||
DISKO_FILE="installer/disko-ext4.nix"
|
DISKO_FILE="installer/disko-ext4.nix"
|
||||||
else
|
else
|
||||||
DISKO_FILE="installer/disko-btrfs-luks.nix"
|
DISKO_FILE="installer/disko-btrfs-luks.nix"
|
||||||
echo "Enable Impermanence? (Erase root partition on every boot)"
|
echo "Enable Impermanence? (Erase root on every boot)"
|
||||||
IMPERMANENCE=$(gum choose "Yes" "No")
|
IMPERMANENCE=$(gum choose "No" "Yes")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/etc/$(basename "$DISKO_FILE")" ]; then
|
# 3. User & Localization
|
||||||
DISKO_NIX="/etc/$(basename "$DISKO_FILE")"
|
section "User & Localization"
|
||||||
else
|
USERNAME=$(gum input --placeholder "Enter target username (no spaces)")
|
||||||
DISKO_NIX="$NOMARCHY_REPO/$DISKO_FILE"
|
if [ -z "$USERNAME" ]; then exit 1; fi
|
||||||
fi
|
|
||||||
|
|
||||||
TMP_DISKO=$(mktemp --suffix=.nix)
|
echo "Select Timezone:"
|
||||||
sed "s|@TARGET_DRIVE@|$TARGET_DRIVE|g" "$DISKO_NIX" > "$TMP_DISKO"
|
|
||||||
sudo env PATH="$PATH" disko --mode disko "$TMP_DISKO"
|
|
||||||
|
|
||||||
# 3. User Details
|
|
||||||
USERNAME=$(gum input --placeholder "Enter target username")
|
|
||||||
if [ -z "$USERNAME" ]; then
|
|
||||||
echo "No username entered. Exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 4. Localization
|
|
||||||
echo "Select your Timezone (e.g., America/New_York, Europe/London):"
|
|
||||||
TIMEZONES=$(timedatectl list-timezones || echo "UTC")
|
TIMEZONES=$(timedatectl list-timezones || echo "UTC")
|
||||||
TIMEZONE=$(echo "$TIMEZONES" | gum filter --placeholder "Type to search timezones...")
|
TIMEZONE=$(echo "$TIMEZONES" | gum filter --placeholder "Type to search...")
|
||||||
if [ -z "$TIMEZONE" ]; then
|
[ -z "$TIMEZONE" ] && TIMEZONE="UTC"
|
||||||
echo "No timezone selected. Defaulting to UTC."
|
|
||||||
TIMEZONE="UTC"
|
echo "Select Keyboard Layout:"
|
||||||
|
KEYBOARD_LAYOUT=$(gum choose "us" "uk" "de" "fr" "es" "it" "br-abnt2" "latam" "Other...")
|
||||||
|
if [ "$KEYBOARD_LAYOUT" = "Other..." ]; then
|
||||||
|
KEYBOARD_LAYOUT=$(gum input --placeholder "Enter layout (e.g. jp)")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Select your Keyboard Layout:"
|
# 4. Software Profiles
|
||||||
LAYOUT_SELECTION=$(gum choose "us" "uk" "de" "fr" "es" "it" "br-abnt2" "latam" "Other...")
|
section "Software Profiles"
|
||||||
if [ "$LAYOUT_SELECTION" = "Other..." ]; then
|
echo "Select additional profiles (Space to toggle):"
|
||||||
KEYBOARD_LAYOUT=$(gum input --placeholder "Enter your keyboard layout (e.g., jp, se, ch)")
|
|
||||||
else
|
|
||||||
KEYBOARD_LAYOUT="$LAYOUT_SELECTION"
|
|
||||||
fi
|
|
||||||
if [ -z "$KEYBOARD_LAYOUT" ]; then
|
|
||||||
echo "No layout selected. Defaulting to us."
|
|
||||||
KEYBOARD_LAYOUT="us"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 4.5. Software Profiles
|
|
||||||
echo "Select additional software profiles to install (Press Space to select, Enter to confirm):"
|
|
||||||
PROFILES=$(gum choose --no-limit "Development (VSCode, Docker, DBs)" "Gaming (Steam, Lutris)" "Media Production (OBS, Kdenlive)")
|
PROFILES=$(gum choose --no-limit "Development (VSCode, Docker, DBs)" "Gaming (Steam, Lutris)" "Media Production (OBS, Kdenlive)")
|
||||||
|
|
||||||
PROFILE_SYSTEM_PKGS=""
|
|
||||||
PROFILE_HOME_PKGS=""
|
PROFILE_HOME_PKGS=""
|
||||||
PROFILE_SYSTEM_CONFIG=""
|
PROFILE_SYSTEM_CONFIG=""
|
||||||
|
|
||||||
if [[ $PROFILES == *"Development"* ]]; then
|
[[ $PROFILES == *"Development"* ]] && PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n vscode\n docker-compose\n dbeaver-bin" && PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n virtualisation.docker.enable = true;"
|
||||||
PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n vscode\n docker-compose\n dbeaver-bin"
|
[[ $PROFILES == *"Gaming"* ]] && PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n lutris\n protonup-qt\n mangohud" && PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n programs.steam.enable = true;"
|
||||||
PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n virtualisation.docker.enable = true;"
|
[[ $PROFILES == *"Media Production"* ]] && PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n obs-studio\n kdenlive\n gimp\n audacity"
|
||||||
fi
|
[[ "$IMPERMANENCE" == "Yes" ]] && PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n nomarchy.system.impermanence.enable = true;"
|
||||||
if [[ $PROFILES == *"Gaming"* ]]; then
|
|
||||||
PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n lutris\n protonup-qt\n mangohud"
|
# 5. Review
|
||||||
PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n programs.steam.enable = true;"
|
section "Review Configuration"
|
||||||
fi
|
echo "Target Drive: $TARGET_DRIVE"
|
||||||
if [[ $PROFILES == *"Media Production"* ]]; then
|
echo "Layout: $LAYOUT (Impermanence: $IMPERMANENCE)"
|
||||||
PROFILE_HOME_PKGS="$PROFILE_HOME_PKGS\n obs-studio\n kdenlive\n gimp\n audacity"
|
echo "User: $USERNAME"
|
||||||
|
echo "Timezone: $TIMEZONE"
|
||||||
|
echo "Profiles: $PROFILES"
|
||||||
|
|
||||||
|
if ! gum confirm "Ready to begin installation?"; then
|
||||||
|
echo "Aborted."
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$IMPERMANENCE" == "Yes" ]]; then
|
# 6. Execution
|
||||||
PROFILE_SYSTEM_CONFIG="$PROFILE_SYSTEM_CONFIG\n nomarchy.system.impermanence.enable = true;"
|
section "Executing Installation"
|
||||||
fi
|
|
||||||
|
|
||||||
# 5. Login Preferences
|
# 6.1. Partitioning
|
||||||
echo "Select login preference:"
|
gum spin --spinner pulse --title "Partitioning $TARGET_DRIVE..." -- bash -c "
|
||||||
LOGIN_PREF=$(gum choose "SDDM Auto-login" "Require Password")
|
DISKO_NIX=\"$NOMARCHY_REPO/$DISKO_FILE\"
|
||||||
|
TMP_DISKO=\$(mktemp --suffix=.nix)
|
||||||
|
sed \"s|@TARGET_DRIVE@|$TARGET_DRIVE|g\" \"\$DISKO_NIX\" > \"\$TMP_DISKO\"
|
||||||
|
sudo env PATH=\"\$PATH\" disko --mode disko \"\$TMP_DISKO\"
|
||||||
|
"
|
||||||
|
|
||||||
# Generate /mnt/etc/nixos/login-preference.nix
|
# 6.2. Scaffold Config
|
||||||
|
gum spin --spinner pulse --title "Generating NixOS configuration..." -- bash -c "
|
||||||
mkdir -p /mnt/etc/nixos/
|
mkdir -p /mnt/etc/nixos/
|
||||||
cat <<EOF > /mnt/etc/nixos/login-preference.nix
|
cat <<EOF > /mnt/etc/nixos/login-preference.nix
|
||||||
{
|
{
|
||||||
services.displayManager.autoLogin.enable = $(if [ "$LOGIN_PREF" = "SDDM Auto-login" ]; then echo "true"; else echo "false"; fi);
|
services.displayManager.autoLogin.enable = true;
|
||||||
services.displayManager.autoLogin.user = "$USERNAME";
|
services.displayManager.autoLogin.user = \"$USERNAME\";
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate /mnt/etc/nixos/localization.nix
|
|
||||||
cat <<EOF > /mnt/etc/nixos/localization.nix
|
cat <<EOF > /mnt/etc/nixos/localization.nix
|
||||||
{
|
{
|
||||||
time.timeZone = "$TIMEZONE";
|
time.timeZone = \"$TIMEZONE\";
|
||||||
services.xserver.xkb.layout = "$KEYBOARD_LAYOUT";
|
services.xserver.xkb.layout = \"$KEYBOARD_LAYOUT\";
|
||||||
console.keyMap = "$KEYBOARD_LAYOUT";
|
console.keyMap = \"$KEYBOARD_LAYOUT\";
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate /mnt/etc/nixos/hardware-selection.nix
|
|
||||||
cat <<EOF > /mnt/etc/nixos/hardware-selection.nix
|
cat <<EOF > /mnt/etc/nixos/hardware-selection.nix
|
||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
$(echo -e "$HARDWARE_MODULES")
|
\$(echo -e \"$HARDWARE_MODULES\")
|
||||||
];
|
];
|
||||||
|
|
||||||
$NOMARCHY_HW_OPTS
|
$NOMARCHY_HW_OPTS
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# 6. Hardware Config
|
|
||||||
nixos-generate-config --root /mnt
|
nixos-generate-config --root /mnt
|
||||||
|
|
||||||
# 7. Modular Downstream Scaffolding
|
|
||||||
mkdir -p /mnt/etc/nixos/
|
|
||||||
|
|
||||||
# Create system.nix (User System Customization)
|
|
||||||
cat <<EOF > /mnt/etc/nixos/system.nix
|
cat <<EOF > /mnt/etc/nixos/system.nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
# Add your personal system-level NixOS settings here.
|
\$(echo -e \"$PROFILE_SYSTEM_CONFIG\")
|
||||||
# This file is for your own custom NixOS modules.
|
environment.systemPackages = with pkgs; [];
|
||||||
$(echo -e "$PROFILE_SYSTEM_CONFIG")
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
# Add extra system-wide packages here
|
|
||||||
# wget
|
|
||||||
# htop$(echo -e "$PROFILE_SYSTEM_PKGS")
|
|
||||||
];
|
|
||||||
|
|
||||||
# Example: How to persist extra directories if using Impermanence
|
|
||||||
# environment.persistence."/persist" = {
|
|
||||||
# directories = [
|
|
||||||
# "/var/lib/docker"
|
|
||||||
# "/root/.ssh"
|
|
||||||
# ];
|
|
||||||
# files = [
|
|
||||||
# "/etc/my-secret-token.txt"
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create home.nix (User Home Customization)
|
|
||||||
cat <<EOF > /mnt/etc/nixos/home.nix
|
cat <<EOF > /mnt/etc/nixos/home.nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
# Add your personal Home Manager settings here.
|
|
||||||
# This file is for your own custom user modules.
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Add extra user-level packages here
|
\$(echo -e \"$PROFILE_HOME_PKGS\")
|
||||||
# neofetch
|
|
||||||
# ripgrep$(echo -e "$PROFILE_HOME_PKGS")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Example: How to override Nomarchy defaults
|
|
||||||
# nomarchy.fonts.monospace = "FiraCode Nerd Font";
|
|
||||||
|
|
||||||
# Example: Easy configuration overrides
|
|
||||||
# Place your custom configs in an 'overrides' folder next to home.nix
|
|
||||||
# nomarchy.configOverrides = ./overrides;
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create the Master Flake
|
|
||||||
cat <<EOF > /mnt/etc/nixos/flake.nix
|
cat <<EOF > /mnt/etc/nixos/flake.nix
|
||||||
{
|
{
|
||||||
description = "My Nomarchy - Downstream Configuration";
|
description = \"My Nomarchy - Downstream Configuration\";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
nixpkgs.url = \"github:nixos/nixpkgs/nixos-25.11\";
|
||||||
nomarchy.url = "git+https://git.bemagri.xyz/bernardo/Nomarchy.git";
|
nomarchy.url = \"git+https://git.bemagri.xyz/bernardo/Nomarchy.git\";
|
||||||
|
nixos-hardware.url = \"github:NixOS/nixos-hardware/master\";
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-25.11";
|
url = \"github:nix-community/home-manager/release-25.11\";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = \"nixpkgs\";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nomarchy, home-manager, ... }@inputs: {
|
outputs = { self, nixpkgs, nomarchy, home-manager, ... }@inputs: {
|
||||||
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.default = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = { inputs = nomarchy.inputs // inputs; };
|
specialArgs = { inputs = nomarchy.inputs // inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
{ nixpkgs.hostPlatform = "x86_64-linux"; }
|
{ nixpkgs.hostPlatform = \"x86_64-linux\"; }
|
||||||
# 1. Hardware
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./hardware-selection.nix
|
./hardware-selection.nix
|
||||||
|
|
||||||
# 2. Login & Preferences
|
|
||||||
./login-preference.nix
|
./login-preference.nix
|
||||||
./localization.nix
|
./localization.nix
|
||||||
|
|
||||||
# 3. Upstream Nomarchy Core
|
|
||||||
nomarchy.nixosModules.system
|
nomarchy.nixosModules.system
|
||||||
|
|
||||||
# 4. User System Customization
|
|
||||||
./system.nix
|
./system.nix
|
||||||
|
|
||||||
# 5. Home Manager Integration
|
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.users.$USERNAME = {
|
home-manager.users.$USERNAME = {
|
||||||
imports = [
|
imports = [ nomarchy.nixosModules.home ./home.nix ];
|
||||||
nomarchy.nixosModules.home
|
home.username = \"$USERNAME\";
|
||||||
./home.nix
|
home.homeDirectory = \"/home/$USERNAME\";
|
||||||
];
|
home.stateVersion = \"25.11\";
|
||||||
home.username = "$USERNAME";
|
|
||||||
home.homeDirectory = "/home/$USERNAME";
|
|
||||||
home.stateVersion = "25.11";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -317,8 +258,9 @@ cat <<EOF > /mnt/etc/nixos/flake.nix
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
"
|
||||||
|
|
||||||
# 8. Version Control
|
# 6.3. Git Init
|
||||||
cd /mnt/etc/nixos/
|
cd /mnt/etc/nixos/
|
||||||
git init
|
git init
|
||||||
git add .
|
git add .
|
||||||
@@ -326,14 +268,31 @@ git config user.name "Nomarchy Installer"
|
|||||||
git config user.email "installer@nomarchy"
|
git config user.email "installer@nomarchy"
|
||||||
git commit -m "Initial Nomarchy generation"
|
git commit -m "Initial Nomarchy generation"
|
||||||
|
|
||||||
# 8.5. Impermanence Redirection
|
# 6.4. Impermanence logic
|
||||||
if [[ "$IMPERMANENCE" == "Yes" ]]; then
|
if [[ "$IMPERMANENCE" == "Yes" ]]; then
|
||||||
echo "Redirecting /etc/nixos to persistent storage..."
|
echo "Redirecting to persistent storage..."
|
||||||
mkdir -p /mnt/persist/etc
|
mkdir -p /mnt/persist/etc
|
||||||
mv /mnt/etc/nixos /mnt/persist/etc/
|
mv /mnt/etc/nixos /mnt/persist/etc/
|
||||||
mkdir -p /mnt/etc
|
mkdir -p /mnt/etc
|
||||||
ln -s /persist/etc/nixos /mnt/etc/nixos
|
ln -s /persist/etc/nixos /mnt/etc/nixos
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 9. Execution
|
# 6.5. Install
|
||||||
nixos-install --flake /mnt/etc/nixos#default --no-root-passwd
|
section "Installing System"
|
||||||
|
echo "Starting nixos-install. This will take some time..."
|
||||||
|
sudo nixos-install --flake /mnt/etc/nixos#default --no-root-passwd
|
||||||
|
|
||||||
|
# 7. Finished
|
||||||
|
header
|
||||||
|
gum style --foreground 10 --bold "INSTALLATION COMPLETE!"
|
||||||
|
echo "Nomarchy has been successfully installed on $TARGET_DRIVE."
|
||||||
|
echo
|
||||||
|
echo "What's next?"
|
||||||
|
echo "1. Remove the installation media."
|
||||||
|
echo "2. Reboot your computer."
|
||||||
|
echo "3. Log in and run 'nomarchy-update' to finish setup."
|
||||||
|
echo
|
||||||
|
|
||||||
|
if gum confirm "Reboot now?"; then
|
||||||
|
reboot
|
||||||
|
fi
|
||||||
|
|||||||
@@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme;
|
xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme;
|
||||||
|
|
||||||
|
# Expose branding assets
|
||||||
|
xdg.configFile."nomarchy/branding/logo.png".source = ../../assets/branding/logo.png;
|
||||||
|
xdg.configFile."nomarchy/branding/logo.txt".source = ../../assets/branding/logo.txt;
|
||||||
|
|
||||||
# Expose all themes to the system via local share for script accessibility
|
# Expose all themes to the system via local share for script accessibility
|
||||||
xdg.dataFile."nomarchy/themes".source = ../../themes;
|
xdg.dataFile."nomarchy/themes".source = ../../themes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,27 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nomarchy-plymouth = pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "nomarchy-plymouth";
|
||||||
|
version = "1.0";
|
||||||
|
|
||||||
|
src = ../../assets/plymouth;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/plymouth/themes/nomarchy
|
||||||
|
cp * $out/share/plymouth/themes/nomarchy/
|
||||||
|
# Fix path in the plymouth file to point to the nix store if needed,
|
||||||
|
# but usually Plymouth looks in its theme dir.
|
||||||
|
sed -i "s|/etc/plymouth/themes/nomarchy|$out/share/plymouth/themes/nomarchy|g" $out/share/plymouth/themes/nomarchy/nomarchy.plymouth
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
boot.initrd.systemd.enable = true;
|
boot.initrd.systemd.enable = true;
|
||||||
boot.plymouth = {
|
boot.plymouth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
themePackages = [ nomarchy-plymouth ];
|
||||||
|
theme = "nomarchy";
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernelParams = [ "quiet" "splash" "loglevel=3" ];
|
boot.kernelParams = [ "quiet" "splash" "loglevel=3" ];
|
||||||
|
|||||||
Reference in New Issue
Block a user