Files
Nomarchy/flake.nix
Bernardo Magri 3bdfc3552e feat: bump to NixOS 26.05 (Yarara) — WIP, desktop unverified on hardware
Bumps nixpkgs nixos-25.11 -> nixos-26.05, home-manager release-25.11 ->
release-26.05, and pins stylix to release-26.05 (was unpinned master).
`nix flake check --no-build` and `nomarchy-eval-matrix` are both clean and
the full system builds (nixos-system-nomarchy-26.05).

Breaking-change fixes required by 26.05:
- stylix-compat: drop the `programs.neovim.initLua` shim — HM 26.05 declares
  it natively, so the shim was a duplicate-option error.
- swww was renamed to awww (binaries gone, no `init` subcommand). Dropped swww
  entirely and unified the wallpaper path on swaybg (the daemon this distro
  actually runs): nomarchy-theme-bg-next now delegates to nomarchy-theme-bg-set,
  swaybg added to the theme-engine script deps, swww removed from package lists.
- default config: add a placeholder `fileSystems."/"` — 26.05's systemd stage-1
  forces fsType during plain toplevel eval (the VM build overrides it).
- services.resolved: extraConfig removed, domains/fallbackDns renamed -> migrated
  to settings.Resolve.* (RFC42).
- systemd.sleep.extraConfig removed -> settings.Sleep.HibernateDelaySec (RFC42).
- X11 'virtio' video driver removed -> dropped from vm-guest.nix and
  nomarchy-live.nix (modesetting drives virtio-gpu).
- nomarchy-eval-matrix: define /persist + /home in the impermanence scenarios
  (26.05 maps fsType over every neededForBoot filesystem).
- README/MIGRATION/installer: stale swww references -> swaybg.

KNOWN BLOCKER (why this is on a branch, not main):
In a headless QEMU VM, Hyprland boots and inits GL (virgl) fine but is
OOM-killed after ~19s (3.4 GB peak). Likely a no-display-consumer artifact of
headless rendering (unthrottled frames), but a real Hyprland-26.05 memory
regression can't be ruled out without a real display. Verify on real hardware
(a fresh ISO install) before merging to main; if the desktop is stable there,
the OOM was the headless VM and this can merge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 15:46:17 +01:00

316 lines
11 KiB
Nix

{
description = "Nomarchy - A NixOS-based distribution with Omarchy flavour";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
nixos-hardware.url = "github:NixOS/nixos-hardware";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix-colors is a pure data flake (base16 schemes) — it has no inputs,
# so any `inputs.X.follows` declaration here triggers a "non-existent
# input" warning. Just URL it.
nix-colors.url = "github:misterio77/nix-colors";
stylix = {
# Pinned to the matching release branch (tested against nixpkgs 26.05)
# rather than master, which targets unstable.
url = "github:danth/stylix/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
walker = {
url = "github:abenz1267/walker";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: let
system = "x86_64-linux";
lib = nixpkgs.lib;
# Shared Nomarchy helpers (palette loader, theme name list, wallpaper /
# icon-theme resolvers, base16 mapper). Importing here makes lib/default.nix
# the single source of truth — modules that need palette data import
# `../../lib` the same way and resolve to the same evaluation.
nomarchyLib = import ./lib { inherit lib; };
# Overlays — the function form lives here so both Nomarchy itself and
# any downstream flake (see `overlays.default` in the outputs) can layer
# the same Nomarchy packages onto their nixpkgs.
nomarchyOverlay = final: prev: {
makima-bin = prev.makima;
nomarchy-system-scripts = final.callPackage ./core/system/scripts-derivation.nix { };
};
overlays = [ nomarchyOverlay ];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
# Helper to create standalone home configurations
mkHome = { username, modules ? [] }: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./features
{
home.username = username;
home.homeDirectory = "/home/${username}";
home.stateVersion = "25.11";
}
] ++ modules;
};
homeConfigs = {
"nixos" = mkHome { username = "nixos"; };
"nomarchy" = mkHome { username = "nomarchy"; };
};
# Realise the full HM generation for every palette so theme switches hit
# the Nix cache instead of rebuilding Stylix outputs per swap. Each entry
# pins `nomarchy.theme` (and clears the wallpaper override so the theme's
# own default background is used) and exposes the generation's activation
# package under its theme name.
inherit (nomarchyLib) themeNames;
themeVariantFor = themeName: (mkHome {
username = "nomarchy";
modules = [{
nomarchy.theme = lib.mkForce themeName;
nomarchy.wallpaper = lib.mkForce "";
nomarchy.apps = {
alacritty.enable = true;
btop.enable = true;
elephant.enable = true;
swayosd.enable = true;
walker.enable = true;
vscode.enable = true;
kitty.enable = true;
lazygit.enable = true;
tmux.enable = true;
};
home.packages = with pkgs; [
firefox
xfce.thunar
imv
mpv
fastfetch
chromium
];
}];
}).activationPackage;
allThemeVariants = pkgs.linkFarm "nomarchy-all-theme-variants"
(map (name: { inherit name; path = themeVariantFor name; }) themeNames);
in {
# Expose inputs for downstream use
inherit inputs;
# Downstream flakes consume this to layer Nomarchy's packages onto their
# own nixpkgs. Used by the installer-generated flake so both the
# nixosSystem and the standalone homeManagerConfiguration share one
# `pkgs` with the overlay applied.
overlays.default = nomarchyOverlay;
nixosModules = {
system = import ./core;
home = import ./features;
};
nixosConfigurations = {
# Minimal TTY installer ISO (new golden path)
nomarchy-installer = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = overlays;
}
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./hosts/nomarchy-installer.nix
{
system.stateVersion = "25.11";
networking.hostName = "nomarchy-installer";
}
];
};
# Installer VM for testing
installerVm = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = overlays;
}
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./hosts/nomarchy-installer.nix
{
system.stateVersion = "25.11";
networking.hostName = "nomarchy-installer-vm";
virtualisation.vmVariant.virtualisation.memorySize = 4096;
virtualisation.vmVariant.virtualisation.cores = 2;
}
];
};
# Graphical installer ISO (legacy, for users who prefer GUI)
nomarchy-live = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = overlays;
}
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-base.nix"
home-manager.nixosModules.home-manager
./hosts/nomarchy-live.nix
./core
{
system.stateVersion = "25.11";
networking.hostName = "nomarchy-live";
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "nixos";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "hm-bak";
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.nixos = {
imports = [ ./features ];
home.stateVersion = "25.11";
nomarchy.apps = {
alacritty.enable = true;
btop.enable = true;
elephant.enable = true;
swayosd.enable = true;
walker.enable = true;
vscode.enable = true;
kitty.enable = true;
lazygit.enable = true;
tmux.enable = true;
};
home.packages = with pkgs; [
firefox
xfce.thunar
imv
mpv
fastfetch
chromium
];
# Live-ISO-only welcome. Pops a notification a few seconds
# after the graphical session is up and opens a terminal
# parked at the installer command, so the user never has to
# hunt for it.
wayland.windowManager.hyprland.extraConfig = nixpkgs.lib.mkAfter ''
exec-once = sh -c 'sleep 3; notify-send -u critical -t 0 "Welcome to Nomarchy" "Run \`sudo /etc/install.sh\` in the open terminal or \`--dry-run\` to preview."'
exec-once = sh -c 'sleep 4; alacritty --title "Nomarchy Installer" -e bash -lc "echo; echo \"Welcome to the Nomarchy live ISO.\"; echo; echo \" sudo /etc/install.sh # install\"; echo \" sudo /etc/install.sh --dry-run # preview only\"; echo \" sudo /etc/install.sh --resume # resume after an interrupt\"; echo; exec bash"'
'';
};
}
];
};
# Default configuration (VM and testing)
default = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.overlays = overlays;
}
home-manager.nixosModules.home-manager
./core/default.nix
./core/system/vm-guest.nix
{
system.stateVersion = "25.11";
networking.hostName = "nomarchy";
# This config is only ever built as a VM (`.build.vm`), where the
# qemu-vm module supplies the real root fs (via mkVMOverride). But
# nixpkgs 26.05's systemd stage-1 forces `fileSystems."/".fsType`
# during plain toplevel evaluation (`nix flake check`), so provide a
# placeholder root fs for eval; the VM build overrides it.
fileSystems."/" = lib.mkDefault { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; };
virtualisation.vmVariant.virtualisation.memorySize = 4096;
virtualisation.vmVariant.virtualisation.cores = 2;
# Setup default user for testing
users.users.nomarchy = {
isNormalUser = true;
extraGroups = [ "wheel" "video" "render" "networkmanager" ];
initialPassword = "nixos";
};
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "nomarchy";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "hm-bak";
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.nomarchy = {
imports = [ ./features ];
home.stateVersion = "25.11";
nomarchy.apps = {
alacritty.enable = true;
btop.enable = true;
elephant.enable = true;
swayosd.enable = true;
walker.enable = true;
vscode.enable = true;
kitty.enable = true;
lazygit.enable = true;
tmux.enable = true;
};
home.packages = with pkgs; [
firefox
xfce.thunar
imv
mpv
fastfetch
chromium
];
};
}
];
};
};
homeConfigurations = homeConfigs;
packages.${system} = {
# Pre-cache every theme's Home Manager generation so subsequent
# `nomarchy-theme-set` swaps are cache hits (no Stylix rebuild, no
# downloads). Run once after install:
# nix build /etc/nomarchy#allThemeVariants --no-link
inherit allThemeVariants;
default = allThemeVariants;
# Expose installer VM as a package
installerVm = self.nixosConfigurations.installerVm.config.system.build.vm;
};
apps.${system} = {
installerVm = {
type = "app";
program = "${self.packages.${system} .installerVm}/bin/run-nomarchy-installer-vm";
};
};
};
}