machines/configuration.nix wired hermes-agent.nixosModules.default into
mibook's mibook-only modules list. modules/environments/default.nix is
machine-agnostic, so jupiter still evaluated a
services.hermes-agent = lib.mkIf false { ... } definition for an option it
never declared as existing — NixOS errors on that regardless of mkIf's
condition, breaking nixosConfigurations.jupiter (and the repo's sole CI
job) entirely.
Fix: import the upstream module unconditionally from inside
modules/environments/hermes-agent/default.nix itself, so the option is
declared everywhere modules/environments/default.nix loads, and only ever
turned on where my.profiles.hermes-agent.enable = true (mibook). Also adds
users.users.finn.extraGroups = [ "hermes" ], required for the hermes CLI to
be usable per the corrected design. machines/configuration.nix no longer
mentions hermes-agent.
Deviates from the reconciled spec/plan text in one respect: uses `self`
(from specialArgs) instead of `inputs` (from _module.args) to reach the
flake input inside `imports`. Using `inputs` there reproduced infinite
recursion — NixOS resolves a module's imports before _module.args
assignments are merged, so an import list cannot depend on an arg that
itself comes from config. `self` is available at import-time via
specialArgs, `inputs` is not, in this repo's wiring. See report for detail.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbvwg3Qt2u9nbkEA3wL17S
70 lines
1.6 KiB
Nix
70 lines
1.6 KiB
Nix
{ self, ... }:
|
|
let
|
|
inherit (self.inputs)
|
|
nixpkgs
|
|
nixpkgs-unstable
|
|
nixos-hardware
|
|
sops-nix
|
|
#hyprland
|
|
;
|
|
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
|
|
overlay-unstable = final: prev: {
|
|
unstable = import nixpkgs-unstable {
|
|
inherit (final) system;
|
|
config.allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
customModules = import ./core/default.nix;
|
|
baseModules = [
|
|
# make flake inputs accessible in NixOS
|
|
{
|
|
_module.args.self = self;
|
|
_module.args.inputs = self.inputs;
|
|
}
|
|
{
|
|
imports = [
|
|
(
|
|
{ pkgs, ... }:
|
|
{
|
|
nixpkgs.overlays = [
|
|
overlay-unstable
|
|
(import ../pkgs)
|
|
];
|
|
nix.nixPath = [
|
|
"nixpkgs=${pkgs.path}"
|
|
];
|
|
documentation.info.enable = false;
|
|
}
|
|
)
|
|
#hyprland.nixosModules.default
|
|
];
|
|
}
|
|
../modules
|
|
sops-nix.nixosModules.sops
|
|
# ../profiles
|
|
];
|
|
defaultModules = baseModules ++ customModules;
|
|
in
|
|
{
|
|
flake.nixosConfigurations = {
|
|
# use your hardware- model from this list: https://github.com/NixOS/nixos-hardware/blob/master/flake.nix
|
|
jupiter = nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = { inherit self; };
|
|
modules = defaultModules ++ [
|
|
# nixos-hardware.nixosModules.bmax-b7-power
|
|
./jupiter/configuration.nix
|
|
];
|
|
};
|
|
mibook = nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = { inherit self; };
|
|
modules = defaultModules ++ [
|
|
# nixos-hardware.nixosModules.mibook
|
|
./mibook/configuration.nix
|
|
];
|
|
};
|
|
};
|
|
}
|