diff --git a/README.md b/README.md index 5009be7..7a48b18 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ partial. │ Stylix → GTK, Qt, cursors, fonts │ └───────────────────────────────────┬──────────────────────────────────────┘ ▼ - wallpaper via swww (the one runtime piece: + wallpaper via awww (the one runtime piece: applied post-switch + at session start, `bg next` cycles) ``` @@ -34,6 +34,7 @@ Flat on purpose. Two module trees, one options file each, no hidden layers. ``` . ├── flake.nix # inputs + the downstream API (exports below) +├── lib.nix # nomarchy.lib.mkFlake — one-call downstream wrapper ├── theme-state.json # ★ THE single source of truth (git-tracked!) ├── themes/ # 21 presets: .json + optional / assets │ ├── nord.json # palette (required, works alone) @@ -94,8 +95,30 @@ mkdir my-machine && cd my-machine nix flake init -t github:YOUR-USER/nomarchy ``` -You own three files: `system.nix`, `home.nix`, and **your own -`theme-state.json`**. Two deliberately separate rebuild paths: +You own two files day-to-day: `system.nix` and `home.nix` (plus +`theme-state.json`, written by the CLI). Your `flake.nix` is set up once — +later by the installer — and never hand-edited; it's a single call: + +```nix +outputs = { nomarchy, ... }: + nomarchy.lib.mkFlake { + src = ./.; + username = "me"; + hardwareProfile = "framework-13-7040-amd"; # optional, nixos-hardware name + }; +``` + +| `mkFlake` arg | Default | Purpose | +|---|---|---| +| `src` | — (required) | Your flake directory (`./.`) | +| `username` | — (required) | Login name; flows into `system.nix` and names the HM config | +| `hardwareProfile` | `null` | A [nixos-hardware](https://github.com/NixOS/nixos-hardware) module name (pinned + tested by Nomarchy; unknown names fail with suggestions) | +| `system` | `"x86_64-linux"` | Platform | + +(Power users can skip `mkFlake` and wire `nixosModules.nomarchy` / +`homeModules.nomarchy` / `overlays.default` by hand — the wrapper is sugar.) + +Two deliberately separate rebuild paths: ```sh sudo nixos-rebuild switch --flake .#default # system: rare @@ -141,9 +164,10 @@ fonts. No runtime patching means no partial states, and `home-manager generations` is also your theme history. Waybar even restyles in place: it re-reads `style.css` when the symlink flips. -The **wallpaper** is the one runtime piece (swww is imperative; nothing in -Nix consumes the path): applied at session start and after every switch via -a tiny activation hook, cycled instantly with `bg next`. +The **wallpaper** is the one runtime piece (awww — nixpkgs' swww — is +imperative; nothing in Nix consumes the path): applied at session start and +after every switch via a tiny activation hook, cycled instantly with +`bg next`. ### Per-theme app assets (`themes//`) @@ -192,6 +216,6 @@ workspaces · `Print` region screenshot. re-copy on every state write is the main eval tax), then pre-built theme variants if still needed - Plymouth + SDDM/greeter theming from the same JSON -- Interactive installer on the live ISO (disko BTRFS+LUKS, hardware - profiles) — port from old_distro +- Interactive installer on the live ISO (disko BTRFS+LUKS, DMI → + `hardwareProfile` autodetection feeding `mkFlake`) — port from old_distro - `hyprlock`/`hypridle`, swayosd, launch-or-focus UX scripts diff --git a/docs/TESTING.md b/docs/TESTING.md index 2ec2951..aa1608b 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -18,7 +18,9 @@ python3 -m py_compile pkgs/nomarchy-theme-sync/nomarchy-theme-sync.py `nix flake check` needs a Linux machine (or a Linux builder) since all outputs are `x86_64-linux`. It catches type errors, missing options, and -bad merges — most breakage stops here. +bad merges — most breakage stops here. It also evaluates the downstream +template through `lib.mkFlake` (including a real nixos-hardware profile), +so template/wrapper drift fails fast too. ## 2. Build and boot the live ISO @@ -51,7 +53,7 @@ Work through these in order; each one exercises a different layer. | # | Check | Verifies | |---|---|---| -| 1 | Boots to Hyprland with Tokyo Night wallpaper visible | greetd autologin, swww, session start | +| 1 | Boots to Hyprland with Tokyo Night wallpaper visible | greetd autologin, awww, session start | | 2 | Waybar shows at top, themed (blue accent on dark) | HM waybar module, palette baking | | 3 | `SUPER+Return` opens Ghostty with Tokyo Night colors | terminal default, ANSI palette | | 4 | `btop` in the terminal is themed | per-theme asset baking | diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..075584c --- /dev/null +++ b/flake.lock @@ -0,0 +1,347 @@ +{ + "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1765809053, + "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1776754714, + "narHash": "sha256-E3OAK27smtATTmX45uoTSRsVD+Y+ZiVVfgM/tjpbtYg=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "4d508123037e7851ad36ebf7d9c48b0e9e1eb581", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1779670703, + "narHash": "sha256-UdfMivNMwCCqQsYDg5pSz8X2IOaOrIZLIIy+Bg3CO2o=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "942159e73e40bf785816f7f1f5feed9ef3d7c8f9", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1767737596, + "narHash": "sha256-eFujfIUQDgWnSJBablOuG+32hCai192yRdrNHTv0a+s=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "ef02db02bf0ff342734d525b5767814770d85b49", + "type": "github" + }, + "original": { + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "ef02db02bf0ff342734d525b5767814770d85b49", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781063120, + "narHash": "sha256-1UIF/mDJluwJQjmmcZ2j1L2+mjYsefe82QCLj0TYSOg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "baa46aeb6d02e0ba13de67cd35e3d57aedfacf01", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-26.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-hardware": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781020964, + "narHash": "sha256-fS7xTi2j2iso5Hj7RNZLv/acDlCT+fgMVkVk40A7Uco=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "32c2cd9e46286c4eced3dc6b613c659126bf3cca", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1780902259, + "narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1780281641, + "narHash": "sha256-M/+hUKoKbHXpV0xGVfELbN1Ds1aoe3pL5p5/t46YhVo=", + "owner": "nix-community", + "repo": "NUR", + "rev": "30f9ae2f04174de63ba8bcf3580ca90843b28a01", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts", + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "nixpkgs" + ], + "nur": "nur", + "systems": "systems", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1781018772, + "narHash": "sha256-C+cGIUaC6dqfwTbI+BwCd572PbESGA3WYxR1sLTqxkY=", + "owner": "danth", + "repo": "stylix", + "rev": "a378e4c09031fb15a4d65da88aa628f71fc52f6b", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1777806186, + "narHash": "sha256-PDF0/wObw4nIsSBeXVYLsloXOiphXCgIdsrNcVXguKs=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "0c94645546f4f3ddac77a1a5fce54eb95bf50795", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1778379944, + "narHash": "sha256-wPDFzMGSlARlw0Sfsn48Q2+jPSfk6N0Ng6BC/d+7Q24=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "fe0203a198690e71a5ff11e08812a4673de3678d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1778378178, + "narHash": "sha256-OXPXRIQgGwV77HjYRryOHguh4ALX96jkg+tseLkGgHA=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "9cd816033ff969415b190722cddf134e78a5665f", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index ccfbad1..8948555 100644 --- a/flake.nix +++ b/flake.nix @@ -14,9 +14,17 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; + + # Pinned by Nomarchy so distro + hardware quirks are tested together + # (consumed by lib.mkFlake's hardwareProfile). Its nixpkgs input is + # only used by its own CI — follow ours to keep locks/ISO lean. + nixos-hardware = { + url = "github:NixOS/nixos-hardware/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, stylix, ... }: + outputs = { self, nixpkgs, home-manager, stylix, nixos-hardware, ... }: let system = "x86_64-linux"; username = "nomarchy"; # reference host only; downstream picks its own @@ -52,6 +60,14 @@ imports = [ stylix.homeModules.stylix ./modules/home ]; }; + # One-call downstream wrapper — see templates/downstream/flake.nix. + # The generated flake is never hand-edited; machines live in + # system.nix / home.nix. + lib = import ./lib.nix { + inherit nixpkgs home-manager nixos-hardware; + nomarchy = self; + }; + templates.default = { path = ./templates/downstream; description = "Nomarchy machine configuration (downstream flake)"; @@ -62,7 +78,31 @@ default = pkgs.nomarchy-theme-sync; }; + # ─── Checks ──────────────────────────────────────────────────── + # `nix flake check` never evaluates templates/, so exercise the + # downstream template through mkFlake directly (this bypasses the + # template's own three-line flake.nix, which only resolves once + # instantiated — everything else is covered here, including the + # hardwareProfile → nixos-hardware mapping). + checks.${system} = + let + downstream = self.lib.mkFlake { + src = ./templates/downstream; + username = "me"; + hardwareProfile = "framework-13-7040-amd"; # exercises the mapping + }; + in + { + downstream-template-system = + downstream.nixosConfigurations.default.config.system.build.toplevel; + downstream-template-home = + downstream.homeConfigurations.me.activationPackage; + }; + # ─── Reference host ──────────────────────────────────────────── + # Manually wired rather than via lib.mkFlake: the repo-root + # theme-state.json is load-bearing (live ISO + in-repo CLI dev), + # which doesn't match mkFlake's src-layout convention. # Deliberately split rebuild paths: # system → sudo nixos-rebuild switch --flake .#nomarchy (rare) # desktop → home-manager switch --flake .#nomarchy (no sudo; @@ -122,15 +162,24 @@ }; }; + # The standalone CLI that `nomarchy-theme-sync apply` runs for + # theme switching, from the same pinned input. + environment.systemPackages = [ + home-manager.packages.${system}.home-manager + ]; + # Keep the locked flake inputs in the ISO store so theme # switching on the live system works without a network: the # lockfile's narHashes resolve against these paths instead - # of fetching from GitHub. - system.extraDependencies = [ - nixpkgs.outPath - home-manager.outPath - stylix.outPath - ]; + # of fetching from GitHub. Must be *transitive* — evaluating + # the seeded flake also fetches stylix's own inputs. + system.extraDependencies = + let + collectInputs = input: + [ input.outPath ] ++ builtins.concatMap collectInputs + (builtins.attrValues (input.inputs or { })); + in + collectInputs self; } ]; }; diff --git a/lib.nix b/lib.nix new file mode 100644 index 0000000..ff49439 --- /dev/null +++ b/lib.nix @@ -0,0 +1,80 @@ +# Downstream sugar: one call wires a whole machine flake. +# Users own ONLY system.nix, home.nix and theme-state.json; their flake.nix +# is generated once (by `nix flake init -t` or the future installer) and +# never hand-edited. The raw exports (nixosModules/homeModules/overlays) +# in flake.nix remain the escape hatch for power users. +{ nixpkgs, home-manager, nixos-hardware, nomarchy }: + +{ + mkFlake = + { src # the downstream flake directory (./.) + , username # login name; also the homeConfigurations attr + , hardwareProfile ? null # a nixos-hardware module name, or null + , system ? "x86_64-linux" + }: + let + inherit (nixpkgs) lib; + + hardwareModules = + if hardwareProfile == null then + [ ] + else if builtins.hasAttr hardwareProfile nixos-hardware.nixosModules then + [ nixos-hardware.nixosModules.${hardwareProfile} ] + else + throw '' + nomarchy.lib.mkFlake: unknown hardwareProfile "${hardwareProfile}". + ${let + close = builtins.filter + (name: lib.strings.levenshteinAtMost 3 name hardwareProfile) + (builtins.attrNames nixos-hardware.nixosModules); + in + lib.optionalString (close != [ ]) + "Did you mean: ${lib.concatStringsSep ", " close}?\n" + }Valid names are the attribute names of nixos-hardware.nixosModules: + https://github.com/NixOS/nixos-hardware + or list them locally with: + nix eval github:NixOS/nixos-hardware#nixosModules --apply builtins.attrNames + Omit hardwareProfile entirely if your machine has no profile. + ''; + + pkgs = import nixpkgs { + inherit system; + overlays = [ nomarchy.overlays.default ]; + }; + in + { + # System layer — rebuilt rarely: + # sudo nixos-rebuild switch --flake .#default + nixosConfigurations.default = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { inherit username; }; + modules = + [ nomarchy.nixosModules.nomarchy ] + ++ hardwareModules + ++ [ + (src + "/hardware-configuration.nix") # from nixos-generate-config + (src + "/system.nix") + ]; + }; + + # Desktop layer — every theme change, no sudo: + # home-manager switch --flake .# + # (`nomarchy-theme-sync apply` runs this for you.) + homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + modules = [ + nomarchy.homeModules.nomarchy + (src + "/home.nix") + { + # Written by nomarchy-theme-sync; reading it is pure — the + # file is part of the downstream flake's source. + nomarchy.stateFile = src + "/theme-state.json"; + home = { + inherit username; + homeDirectory = "/home/${username}"; + }; + } + ]; + }; + }; +} diff --git a/templates/downstream/README.md b/templates/downstream/README.md index f68fcc3..a791685 100644 --- a/templates/downstream/README.md +++ b/templates/downstream/README.md @@ -1,8 +1,13 @@ # My Nomarchy machine -1. `nixos-generate-config --show-hardware-config > hardware-configuration.nix` -2. Edit `flake.nix` (Nomarchy repo URL, username), `system.nix` (hostname, - user), `home.nix` (your packages). +1. Overwrite the placeholder hardware config with the real one: + `nixos-generate-config --show-hardware-config > hardware-configuration.nix` +2. Set `flake.nix` up **once** (Nomarchy repo URL, your username, optionally + a `hardwareProfile` from — an + unknown name fails the rebuild with suggestions). After that the flake is + never touched again: your machine lives in `system.nix` (hostname, + services — the login user is created from `username` automatically) and + `home.nix` (your packages). 3. `git init && git add -A` — flakes only see tracked files, including `theme-state.json`. 4. System: `sudo nixos-rebuild switch --flake .#default` diff --git a/templates/downstream/flake.nix b/templates/downstream/flake.nix index d83b9ee..47dec08 100644 --- a/templates/downstream/flake.nix +++ b/templates/downstream/flake.nix @@ -1,53 +1,20 @@ { description = "My Nomarchy machine"; - inputs = { - # Pin Nomarchy; nixpkgs and home-manager follow whatever it ships. - nomarchy.url = "github:YOUR-USER/nomarchy"; # <- point at the distro repo - nixpkgs.follows = "nomarchy/nixpkgs"; - home-manager.follows = "nomarchy/home-manager"; - }; + # The only input. nixpkgs, home-manager etc. come pinned through it — + # tested together upstream. This file is written once (by you or the + # installer) and never hand-edited afterwards; your machine lives in + # system.nix and home.nix. + inputs.nomarchy.url = "github:YOUR-USER/nomarchy"; # <- the distro repo - outputs = { self, nomarchy, nixpkgs, home-manager, ... }: - let - system = "x86_64-linux"; + outputs = { nomarchy, ... }: + nomarchy.lib.mkFlake { + src = ./.; username = "me"; # <- your login name - pkgs = import nixpkgs { - inherit system; - overlays = [ nomarchy.overlays.default ]; - }; - in - { - # System layer — rebuilt rarely: - # sudo nixos-rebuild switch --flake .#default - nixosConfigurations.default = nixpkgs.lib.nixosSystem { - inherit system; - modules = [ - nomarchy.nixosModules.nomarchy # the distro - ./hardware-configuration.nix # from `nixos-generate-config` - ./system.nix # your machine - ]; - }; - - # Desktop layer — rebuilt on every theme change, no sudo: - # home-manager switch --flake .#me - # (`nomarchy-theme-sync apply ` runs this for you.) - homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - nomarchy.homeModules.nomarchy - ./home.nix - { - # Your theme state — written by nomarchy-theme-sync, baked - # in on every switch. Keep it git-tracked. - nomarchy.stateFile = ./theme-state.json; - home = { - inherit username; - homeDirectory = "/home/${username}"; - }; - } - ]; - }; + # Optional: a nixos-hardware module name for your machine, e.g. + # hardwareProfile = "framework-13-7040-amd"; + # Names: https://github.com/NixOS/nixos-hardware + # (the future installer fills this in automatically from DMI data) }; } diff --git a/templates/downstream/hardware-configuration.nix b/templates/downstream/hardware-configuration.nix new file mode 100644 index 0000000..5691209 --- /dev/null +++ b/templates/downstream/hardware-configuration.nix @@ -0,0 +1,15 @@ +# PLACEHOLDER — replace with the output of `nixos-generate-config` on the +# target machine. The mkDefault values below only exist so the flake +# evaluates and `nix flake check` passes before first install. +{ lib, ... }: + +{ + boot.initrd.availableKernelModules = lib.mkDefault [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; + + fileSystems."/" = lib.mkDefault { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/templates/downstream/system.nix b/templates/downstream/system.nix index 0b202e3..9c2c1e4 100644 --- a/templates/downstream/system.nix +++ b/templates/downstream/system.nix @@ -2,7 +2,7 @@ # The distro itself comes from nomarchy.nixosModules.nomarchy — override # any of its defaults here with plain NixOS options (they use mkDefault), # or via the nomarchy.system.* toggles. -{ pkgs, ... }: +{ pkgs, username, ... }: { boot.loader.systemd-boot.enable = true; @@ -12,7 +12,8 @@ time.timeZone = "UTC"; i18n.defaultLocale = "en_US.UTF-8"; - users.users.me = { # <- keep in sync with `username` in flake.nix + # Your login user — `username` flows in from flake.nix automatically. + users.users.${username} = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "video" "input" ]; };