Compare commits
3 Commits
81d0f0b542
...
42f515f4a9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42f515f4a9 | ||
|
|
0bd67f1ee0 | ||
|
|
8775c6a4bf |
@@ -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.
|
||||
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.
|
||||
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
|
||||
* **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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
### 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`)
|
||||
Add system-wide packages, services, and hardware tweaks here.
|
||||
|
||||
@@ -10,12 +10,11 @@ mkdir -p "$STATE_DIR"
|
||||
|
||||
THEME_NAME=$(jq -r '.theme // "nord"' "$STATE_FILE")
|
||||
|
||||
if [ -d "/etc/nixos/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nixos/nomarchy/themes"
|
||||
elif [ -d "/etc/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nomarchy/themes"
|
||||
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
|
||||
if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
|
||||
THEMES_DIR="$HOME/.config/nomarchy/themes"
|
||||
else
|
||||
THEMES_DIR="/etc/nixos/themes"
|
||||
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
|
||||
fi
|
||||
|
||||
BG_DIR="$THEMES_DIR/$THEME_NAME/backgrounds"
|
||||
|
||||
@@ -13,13 +13,11 @@ fi
|
||||
STATE_DIR="$HOME/.config/home-manager"
|
||||
STATE_FILE="$STATE_DIR/state.json"
|
||||
|
||||
# Logic for finding themes
|
||||
if [ -d "/etc/nixos/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nixos/nomarchy/themes"
|
||||
elif [ -d "/etc/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nomarchy/themes"
|
||||
# Resolve themes directory (Built-in from Nix store via Home Manager, or user extra)
|
||||
if [ -d "$HOME/.config/nomarchy/themes/$THEME_NAME" ]; then
|
||||
THEMES_DIR="$HOME/.config/nomarchy/themes"
|
||||
else
|
||||
THEMES_DIR="/etc/nixos/themes"
|
||||
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
|
||||
fi
|
||||
|
||||
mkdir -p "$STATE_DIR"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Change gnome modes
|
||||
if [[ -f ~/.config/nomarchy/current/theme/light.mode ]]; then
|
||||
gsettings set org.gnome.desktop.interface color-scheme "prefer-light"
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
|
||||
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
|
||||
fi
|
||||
|
||||
# Change gnome icon theme color
|
||||
GNOME_ICONS_THEME=~/.config/nomarchy/current/theme/icons.theme
|
||||
if [[ -f $GNOME_ICONS_THEME ]]; then
|
||||
gsettings set org.gnome.desktop.interface icon-theme "$(<$GNOME_ICONS_THEME)"
|
||||
else
|
||||
gsettings set org.gnome.desktop.interface icon-theme "Yaru-blue"
|
||||
fi
|
||||
@@ -23,6 +23,9 @@
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: {
|
||||
# Expose inputs for downstream use
|
||||
inherit inputs;
|
||||
|
||||
nixosModules = {
|
||||
system = import ./modules/system;
|
||||
home = import ./modules/home;
|
||||
|
||||
@@ -269,7 +269,7 @@ cat <<EOF > /mnt/etc/nixos/flake.nix
|
||||
|
||||
inputs = {
|
||||
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";
|
||||
home-manager = {
|
||||
@@ -318,11 +318,6 @@ cat <<EOF > /mnt/etc/nixos/flake.nix
|
||||
}
|
||||
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
|
||||
cd /mnt/etc/nixos/
|
||||
git init
|
||||
|
||||
@@ -49,6 +49,8 @@ in
|
||||
mise
|
||||
jq
|
||||
xmlstarlet
|
||||
yaru-theme
|
||||
bibata-cursors
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.roboto-mono
|
||||
nerd-fonts.fira-code
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.nomarchy = {
|
||||
@@ -73,6 +73,28 @@
|
||||
description = "System monospace font.";
|
||||
};
|
||||
};
|
||||
iconsTheme = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "Yaru-blue";
|
||||
description = "System icon theme name.";
|
||||
};
|
||||
isLightMode = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether the current theme is light mode.";
|
||||
};
|
||||
cursor = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "Bibata-Modern-Ice";
|
||||
description = "Mouse cursor theme name.";
|
||||
};
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.bibata-cursors;
|
||||
description = "Package providing the cursor theme.";
|
||||
};
|
||||
};
|
||||
configOverrides = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
|
||||
@@ -117,6 +117,15 @@ in
|
||||
border_size = togglesState.hyprland.border_size or 2;
|
||||
};
|
||||
fonts.monospace = togglesState.font or "JetBrainsMono Nerd Font";
|
||||
|
||||
# Derived properties from the theme directory
|
||||
isLightMode = builtins.pathExists (../../themes + "/${togglesState.theme or "nord"}/light.mode");
|
||||
iconsTheme = let
|
||||
iconsFile = ../../themes + "/${togglesState.theme or "nord"}/icons.theme";
|
||||
in
|
||||
if builtins.pathExists iconsFile
|
||||
then lib.removeSuffix "\n" (builtins.readFile iconsFile)
|
||||
else "Yaru-blue";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ in
|
||||
image = activeWallpaper;
|
||||
base16Scheme = currentPalette;
|
||||
|
||||
# Force dark/light mode based on theme name if possible, or just default to dark
|
||||
polarity = if lib.strings.hasInfix "light" activeThemeName then "light" else "dark";
|
||||
# Use detected light mode state
|
||||
polarity = if config.nomarchy.isLightMode then "light" else "dark";
|
||||
|
||||
cursor = {
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
package = config.nomarchy.cursor.package;
|
||||
name = config.nomarchy.cursor.name;
|
||||
size = 24;
|
||||
};
|
||||
|
||||
@@ -65,4 +65,13 @@ in
|
||||
gnome.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# GTK Icon Theme configuration
|
||||
gtk = {
|
||||
enable = true;
|
||||
iconTheme = {
|
||||
package = pkgs.yaru-theme;
|
||||
name = config.nomarchy.iconsTheme;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -32,19 +32,17 @@ let
|
||||
nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" ''
|
||||
STATE_DIR="$HOME/.config/home-manager"
|
||||
STATE_FILE="$STATE_DIR/state.json"
|
||||
if [ -d "/etc/nixos/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nixos/nomarchy/themes"
|
||||
elif [ -d "/etc/nomarchy/themes" ]; then
|
||||
THEMES_DIR="/etc/nomarchy/themes"
|
||||
else
|
||||
THEMES_DIR="/etc/nixos/themes"
|
||||
fi
|
||||
THEMES_DIR="$HOME/.local/share/nomarchy/themes"
|
||||
|
||||
mkdir -p "$STATE_DIR"
|
||||
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
|
||||
|
||||
# List all images in all themes backgrounds
|
||||
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)
|
||||
|
||||
if [ -n "$SELECTED_WP" ]; then
|
||||
|
||||
Reference in New Issue
Block a user