feat(upstream): switch to remote git repository for engine

- Update installer to use git+https://git.bemagri.xyz/bernardo/Nomarchy.git
- Remove redundant bundling/copying of the engine to /etc/nixos/nomarchy
- Expose all themes via xdg.dataFile for script accessibility
- Update theme scripts to resolve directories via local share instead of hardcoded system paths
- Update documentation to reflect the new remote-first architecture
This commit is contained in:
Bernardo Magri
2026-04-04 17:35:37 +01:00
parent 81d0f0b542
commit 8775c6a4bf
7 changed files with 19 additions and 26 deletions

View File

@@ -25,7 +25,7 @@ The installer is designed to bootstrap a fresh system with this modular structur
1. **Repo Detection:** Identifies the location of the Nomarchy source. 1. **Repo Detection:** Identifies the location of the Nomarchy source.
2. **Scaffolding:** Creates a new downstream `flake.nix` that imports Nomarchy core modules. 2. **Scaffolding:** Creates a new downstream `flake.nix` that imports Nomarchy core modules.
3. **User Files:** Generates skeleton `system.nix` and `home.nix` files for the user to customize. 3. **User Files:** Generates skeleton `system.nix` and `home.nix` files for the user to customize.
4. **Bundling:** Copies the entire Nomarchy source to `/etc/nixos/nomarchy` so the system can be rebuilt offline. 4. **Flake Updates:** Uses the public Git repository as the upstream source, allowing users to update their system via `nix flake update`.
### 3. Home Manager Integration ### 3. Home Manager Integration
* **Hybrid Declarative State:** While the distro is declarative, it uses state files in `~/.config/home-manager/` (managed by the distro's scripts) to allow for instant UI feedback (theming, fonts, wallpapers) without needing a full system rebuild for every small tweak. * **Hybrid Declarative State:** While the distro is declarative, it uses state files in `~/.config/home-manager/` (managed by the distro's scripts) to allow for instant UI feedback (theming, fonts, wallpapers) without needing a full system rebuild for every small tweak.

View File

@@ -48,7 +48,7 @@ The wizard will guide you through:
Nomarchy uses a "Downstream" model. After installation, your configuration lives in `/etc/nixos/` and is split into three main parts: Nomarchy uses a "Downstream" model. After installation, your configuration lives in `/etc/nixos/` and is split into three main parts:
### 1. Distro Core (Upstream) ### 1. Distro Core (Upstream)
Located in `/etc/nixos/nomarchy/`. This is the engine. You should generally not modify files here. Managed via the public Git repository. This is the engine. You should generally not modify files here.
### 2. Your System (`system.nix`) ### 2. Your System (`system.nix`)
Add system-wide packages, services, and hardware tweaks here. Add system-wide packages, services, and hardware tweaks here.

View File

@@ -10,12 +10,11 @@ mkdir -p "$STATE_DIR"
THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE") THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE")
if [ -d "/etc/nixos/nomarchy/themes" ]; then # Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
THEMES_DIR="/etc/nixos/nomarchy/themes" if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
elif [ -d "/etc/nomarchy/themes" ]; then THEMES_DIR="$HOME/.config/nomarchy/themes"
THEMES_DIR="/etc/nomarchy/themes"
else else
THEMES_DIR="/etc/nixos/themes" THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi fi
BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds" BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds"

View File

@@ -13,13 +13,11 @@ fi
STATE_DIR="$HOME/.config/home-manager" STATE_DIR="$HOME/.config/home-manager"
STATE_FILE="$STATE_DIR/state.json" STATE_FILE="$STATE_DIR/state.json"
# Logic for finding themes # Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
if [ -d "/etc/nixos/nomarchy/themes" ]; then if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
THEMES_DIR="/etc/nixos/nomarchy/themes" THEMES_DIR="$HOME/.config/nomarchy/themes"
elif [ -d "/etc/nomarchy/themes" ]; then
THEMES_DIR="/etc/nomarchy/themes"
else else
THEMES_DIR="/etc/nixos/themes" THEMES_DIR="$HOME/.local/share/nomarchy/themes"
fi fi
mkdir -p "$STATE_DIR" mkdir -p "$STATE_DIR"

View File

@@ -269,7 +269,7 @@ cat <<EOF > /mnt/etc/nixos/flake.nix
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nomarchy.url = "path:./nomarchy"; # Offline bundled nomarchy 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 = {
@@ -318,11 +318,6 @@ cat <<EOF > /mnt/etc/nixos/flake.nix
} }
EOF EOF
# 7. Copy Bundled Flake
echo "Copying bundled upstream Nomarchy flake from $NOMARCHY_REPO..."
cp -rL "$NOMARCHY_REPO" /mnt/etc/nixos/nomarchy
chmod -R u+w /mnt/etc/nixos/nomarchy
# 8. Version Control # 8. Version Control
cd /mnt/etc/nixos/ cd /mnt/etc/nixos/
git init git init

View File

@@ -7,4 +7,7 @@
}; };
xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme; xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme;
# Expose all themes to the system via local share for script accessibility
xdg.dataFile."nomarchy/themes".source = ../../themes;
} }

View File

@@ -32,19 +32,17 @@ let
nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" '' nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" ''
STATE_DIR="$HOME/.config/home-manager" STATE_DIR="$HOME/.config/home-manager"
STATE_FILE="$STATE_DIR/state.json" STATE_FILE="$STATE_DIR/state.json"
if [ -d "/etc/nixos/nomarchy/themes" ]; then THEMES_DIR="$HOME/.local/share/nomarchy/themes"
THEMES_DIR="/etc/nixos/nomarchy/themes"
elif [ -d "/etc/nomarchy/themes" ]; then
THEMES_DIR="/etc/nomarchy/themes"
else
THEMES_DIR="/etc/nixos/themes"
fi
mkdir -p "$STATE_DIR" mkdir -p "$STATE_DIR"
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE" [[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
# List all images in all themes backgrounds # List all images in all themes backgrounds
WALLPAPERS=$(find "$THEMES_DIR" -type f \( -name "*.jpg" -o -name "*.png" \)) WALLPAPERS=$(find "$THEMES_DIR" -type f \( -name "*.jpg" -o -name "*.png" \))
# Include user themes if they exist
if [ -d "$HOME/.config/nomarchy/themes" ]; then
WALLPAPERS="$WALLPAPERS\n$(find "$HOME/.config/nomarchy/themes" -type f \( -name "*.jpg" -o -name "*.png" \))"
fi
SELECTED_WP=$(echo -e "$WALLPAPERS" | walker --dmenu) SELECTED_WP=$(echo -e "$WALLPAPERS" | walker --dmenu)
if [ -n "$SELECTED_WP" ]; then if [ -n "$SELECTED_WP" ]; then