Select the CachyOS kernel per-Host via boot.kernelPackages, enable Intel microcode and redistributable firmware (ath10k for the QCA6174 wifi), and move zram behind a toggle Module. Declare the chaotic binary cache in the base Nix settings (extra-substituters/keys) so the built system fetches the kernel from nyx-cache rather than compiling it.
93 lines
3.0 KiB
Nix
93 lines
3.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
inputs,
|
|
...
|
|
}:
|
|
# The Skeleton's shared base config: the pieces every Host carries regardless of
|
|
# which Modules it enables — overlays, the `user`, flakes, and home-manager.
|
|
let
|
|
inherit (lib) mkOption types;
|
|
user = config.user;
|
|
|
|
# Instantiate an extra nixpkgs source for the same platform as the base pkgs.
|
|
pinArgs = prev: {
|
|
inherit (prev.stdenv.hostPlatform) system;
|
|
config.allowUnfree = true;
|
|
};
|
|
in
|
|
{
|
|
options.user = {
|
|
name = mkOption {
|
|
type = types.str;
|
|
default = "alexion";
|
|
description = ''
|
|
The primary interactive user this Host is built for. Drives both the
|
|
system account and the home-manager user in lockstep.
|
|
'';
|
|
};
|
|
description = mkOption {
|
|
type = types.str;
|
|
default = "Alexion";
|
|
description = "Human-readable description (GECOS field) for the primary user.";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
# Base is nixos-unstable; reach a package fresher with `unstable.<name>` or
|
|
# pin it rock-solid with `stable.<name>`. chaotic's overlay is added by its
|
|
# own NixOS module, imported by the host-builder.
|
|
nixpkgs.overlays = [
|
|
(_final: prev: {
|
|
unstable = import inputs.nixpkgs-unstable (pinArgs prev);
|
|
stable = import inputs.nixpkgs-stable (pinArgs prev);
|
|
})
|
|
];
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
# Flakes + a baseline so `nixos-rebuild switch` works from the console.
|
|
nix.settings.experimental-features = [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
|
|
# The chaotic binary cache, declared explicitly on the built system so the
|
|
# CachyOS kernel is substituted rather than compiled. chaotic's own module
|
|
# also provides these, but stating them here keeps the built system's cache
|
|
# config visible and independent of that module. Added via the `extra-`
|
|
# options so they only append — cache.nixos.org and any other substituter
|
|
# are never dropped. (Fetching at install time depends on the installing
|
|
# daemon's substituters, not this — see the chaotic gotcha in CLAUDE.md.)
|
|
nix.settings.extra-substituters = [ "https://nyx-cache.chaotic.cx/" ];
|
|
nix.settings.extra-trusted-public-keys = [
|
|
"nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk="
|
|
];
|
|
environment.systemPackages = [ pkgs.git ];
|
|
|
|
# Primary user, in wheel. No password is set here.
|
|
users.users.${user.name} = {
|
|
isNormalUser = true;
|
|
description = user.description;
|
|
extraGroups = [ "wheel" ];
|
|
};
|
|
|
|
# home-manager as a NixOS module: one `nixos-rebuild switch` builds the
|
|
# system and the user environment atomically, sharing the system's pkgs
|
|
# (with our overlays) and installing user packages into the system profile.
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
extraSpecialArgs = {
|
|
inherit inputs;
|
|
my = inputs.self.lib;
|
|
};
|
|
users.${user.name} = {
|
|
home.username = user.name;
|
|
home.homeDirectory = "/home/${user.name}";
|
|
home.stateVersion = "26.05";
|
|
};
|
|
};
|
|
};
|
|
}
|