feat: make VM and live ISO match an installed Nomarchy
- Migrate VM and graphical ISO to home-manager.nixosModules.home-manager; drop the standalone-HM sudo-based activation script (ran HM against /root because HOME wasn't reset) in flake.nix, core/system/vm-guest.nix, hosts/live-iso.nix. - Run swaybg as nomarchy-wallpaper.service instead of a silent Hyprland exec-once so failures surface in systemctl. - Skip the battery monitor unit on hosts without /sys/class/power_supply/BAT* (VMs, desktops). - Don't wrap walker --dmenu in uwsm-app; redirect setsid background std-fds in nomarchy-launch-walker so $(menu ...) in nomarchy-menu doesn't hang. - Restart waybar/walker via systemctl --user rather than pkill + uwsm-app to stop the post-theme-switch color race. - Wire nomarchy-restart-walker/-waybar into nomarchy-theme-set so themes that only change the imported CSS reload correctly. - Waybar: pin #custom-nomarchy to the Nomarchy font and use the U+F000 codepoint so the logo shows across all themes. - Auto-install the correct icon-theme package per palette via a new nomarchyLib.iconThemePackage helper in lib/default.nix; Everforest now actually renders for summer-night. - Pre-cache every theme's HM generation: new packages.allThemeVariants flake output and nomarchy-themes-prebuild script so theme switches are cache-only (no Stylix rebuild, no downloads). - Add nomarchy-test-live-iso to boot the graphical ISO in QEMU the same way nomarchy-test-vm does, with virtio-gpu support added to live-iso.nix. - Installer-generated home.nix/system.nix now ship a curated, commented app menu (btop/fastfetch/chromium on by default) plus optional system services (Docker, libvirtd, Tailscale, Syncthing, Flatpak, Steam). - nomarchy-test-vm now wipes the stale nomarchy.qcow2 before launch. - Remove obsolete GEMINI.md and PLAN.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
76
flake.nix
76
flake.nix
@@ -35,6 +35,9 @@
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixos-hardware, disko, impermanence, home-manager, nix-colors, stylix, walker, ... } @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
# Overlays
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
@@ -43,13 +46,14 @@
|
||||
})
|
||||
];
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
# Helper to create standalone home configurations
|
||||
mkHome = { username, modules ? [] }: home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit (nixpkgs.legacyPackages.x86_64-linux) system;
|
||||
inherit overlays;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./features
|
||||
@@ -65,6 +69,23 @@
|
||||
"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.
|
||||
palettes = import ./themes/palettes;
|
||||
themeNames = builtins.attrNames palettes;
|
||||
themeVariantFor = themeName: (mkHome {
|
||||
username = "nomarchy";
|
||||
modules = [{
|
||||
nomarchy.theme = lib.mkForce themeName;
|
||||
nomarchy.wallpaper = lib.mkForce "";
|
||||
}];
|
||||
}).activationPackage;
|
||||
allThemeVariants = pkgs.linkFarm "nomarchy-all-theme-variants"
|
||||
(map (name: { inherit name; path = themeVariantFor name; }) themeNames);
|
||||
in {
|
||||
# Expose inputs for downstream use
|
||||
inherit inputs;
|
||||
@@ -94,43 +115,48 @@
|
||||
|
||||
# Graphical installer ISO (legacy, for users who prefer GUI)
|
||||
installerIsoGraphical = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
homeActivationPackage = homeConfigs."nixos".activationPackage;
|
||||
};
|
||||
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/live-iso.nix
|
||||
./core
|
||||
{
|
||||
system.stateVersion = "25.11";
|
||||
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";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Default configuration (VM and testing)
|
||||
default = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
homeActivationPackage = homeConfigs."nomarchy".activationPackage;
|
||||
};
|
||||
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";
|
||||
|
||||
|
||||
virtualisation.vmVariant.virtualisation.memorySize = 4096;
|
||||
virtualisation.vmVariant.virtualisation.cores = 2;
|
||||
|
||||
@@ -143,11 +169,29 @@
|
||||
|
||||
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";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user