Files
Nomarchy/modules/nixos/default.nix
Bernardo Magri f211ef0d09 feat: Nomarchy ground-up rewrite on NixOS 26.05
Full replacement of the previous iteration, rebuilt around three ideas:

- Pure evaluation: theme-state.json lives inside the flake and is read
  via the nomarchy.stateFile option — no --impure, ever.
- All-Home-Manager theming: `nomarchy-theme-sync apply` writes the JSON
  and runs `home-manager switch`; every theme change is one atomic,
  rollbackable generation. Wallpaper (swww) is the sole runtime piece.
- Flat, downstream-first layout: modules/{nixos,home} with one
  options.nix each, exported as nixosModules/homeModules + overlay +
  flake template; system (nixos-rebuild) and desktop (home-manager
  switch) rebuild paths are fully split.

Ships 21 themes imported from the previous iteration (palettes,
wallpapers, btop themes, six whole-swap Waybar identities), Stylix for
the GTK/Qt/cursor long tail, a live ISO target with offline theme
switching, and docs/TESTING.md with the QEMU verification workflow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:59:13 +01:00

101 lines
3.7 KiB
Nix

# Nomarchy — reusable system layer (NixOS 26.05).
#
# This module is the distro: import it from any host (see
# nixosModules.nomarchy in flake.nix) and layer your machine specifics
# (bootloader, hostname, users, hardware) on top. Host concerns are
# deliberately NOT set here. Everything user-facing (Hyprland config,
# Waybar, Ghostty, theming) lives in modules/home.
{ config, lib, pkgs, ... }:
let
cfg = config.nomarchy.system;
in
{
imports = [ ./options.nix ];
config = {
# ── Wayland session: Hyprland ────────────────────────────────────
# Installs the binary, registers the session, wires up
# xdg-desktop-portal-hyprland. Configuration is Home Manager's job.
programs.hyprland.enable = lib.mkDefault true;
xdg.portal = {
enable = lib.mkDefault true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; # file pickers, etc.
};
services.greetd = lib.mkIf cfg.greeter.enable {
enable = lib.mkDefault true;
settings.default_session = {
command = lib.mkDefault "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --cmd Hyprland";
user = "greeter";
};
};
# ── Audio: Pipewire ──────────────────────────────────────────────
security.rtkit.enable = lib.mkDefault cfg.audio.enable;
services.pulseaudio.enable = lib.mkDefault false;
services.pipewire = lib.mkIf cfg.audio.enable {
enable = lib.mkDefault true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
# ── Desktop services ─────────────────────────────────────────────
security.polkit.enable = lib.mkDefault true;
services.gnome.gnome-keyring.enable = lib.mkDefault true;
services.dbus.enable = lib.mkDefault true;
services.upower.enable = lib.mkDefault true;
networking.networkmanager.enable = lib.mkDefault true;
hardware.bluetooth.enable = lib.mkDefault cfg.bluetooth.enable;
services.blueman.enable = lib.mkDefault cfg.bluetooth.enable;
# ── Fonts ────────────────────────────────────────────────────────
fonts = {
packages = with pkgs; [
nerd-fonts.jetbrains-mono
inter
noto-fonts
noto-fonts-color-emoji
];
fontconfig.defaultFonts = {
monospace = lib.mkDefault [ "JetBrainsMono Nerd Font" ];
sansSerif = lib.mkDefault [ "Inter" ];
emoji = lib.mkDefault [ "Noto Color Emoji" ];
};
};
# ── Essential packages ───────────────────────────────────────────
environment.systemPackages = with pkgs; [
nomarchy-theme-sync # provided by overlays.default
git
vim
wget
curl
jq
brightnessctl
playerctl
pamixer
wl-clipboard
grim
slurp
];
# ── Nix itself ───────────────────────────────────────────────────
nix = {
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = lib.mkDefault true;
};
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 14d";
};
};
};
}