remove nixpkgs dependency

YIPPIE YIPPIE YIPPIE
This commit is contained in:
do butterflies cry? 2026-02-16 18:56:34 +10:00
parent 8dc975fc89
commit dc37c482a8
4 changed files with 46 additions and 16 deletions

View file

@ -13,6 +13,9 @@
- [X] rename nixos-modules/ to nixos/
- [X] ensure all machines are in groups.all by default
- [X] fix nixpkgs.nix not working (default not respected)
- [X] remove dependence on nixpkgs
## Low Priority
- [ ] rename extraModules to modules?
- [ ] rename specialArgs to args?

View file

@ -15,7 +15,6 @@
self,
this,
nt,
lib,
inputs,
...
}: let
@ -50,13 +49,8 @@
(nt.naive.terminal)
Terminal
;
missing = msg: path:
Terminal (abort ''
Each Cerulean Nexus node is required to specify ${msg}!
Ensure `nexus.${path}` exists under your call to `cerulean.mkNexus`.
'');
in {
base = null;
extraModules = [];
specialArgs = Terminal {};
@ -188,8 +182,13 @@ in {
customOutputs = removeAttrs decl ["nexus"];
outputs = rec {
nixosConfigurations = mapNodes nexus.nodes (
nodeName: node: let
nixosConfigurations = mapNodes nexus (
{
lib,
nodeName,
node,
...
}: let
nixosDecl = lib.nixosSystem {
system = node.system;
specialArgs = let
@ -219,7 +218,11 @@ in {
nixosDecl
);
deploy.nodes = mapNodes nexus.nodes (nodeName: node: let
deploy.nodes = mapNodes nexus ({
nodeName,
node,
...
}: let
inherit
(node.deploy)
activationTimeout

View file

@ -25,6 +25,12 @@ in rec {
(nt.naive.terminal)
Terminal
;
missing = msg: path:
Terminal (abort ''
Each Cerulean Nexus node is required to specify ${msg}!
Ensure `nexus.${path}` exists under your call to `cerulean.mkNexus`.
'');
in {
enabled = true;
system = "x86_64-linux"; # sane default (i hope...)
@ -32,6 +38,8 @@ in rec {
extraModules = [];
specialArgs = Terminal {};
base = null;
deploy = {
user = "root";
sudo = "sudo -u";
@ -67,7 +75,25 @@ in rec {
in
nt.projectOnto templateAttrs nodeAttrs;
mapNodes = nodes: f:
nodes
|> mapAttrs (nodeName: nodeAttrs: f nodeName (parseNode nodeName nodeAttrs));
mapNodes = nexus: f:
nexus.nodes
|> mapAttrs (nodeName: nodeAttrs: let
node = parseNode nodeName nodeAttrs;
# use per-node base or default to nexus base
base =
if node.base != null
then node.base
else if nexus.base != null
then nexus.base
else
abort ''
Cerulean cannot construct nexus node "${nodeName}" without a base package source.
Ensure `nexus.nodes.*.base` or `nexus.base` is a flake reference to the github:NixOS/nixpkgs repository.
'';
in
f {
inherit nodeName node;
lib = base.lib;
});
}

View file

@ -16,7 +16,7 @@
inputs = {
systems.url = "github:nix-systems/default";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
nt.url = "github:cry128/nt";
home-manager = {
@ -37,14 +37,12 @@
outputs = {
self,
nixpkgs,
nt,
...
} @ inputs:
import ./cerulean
{
inherit inputs self nt;
inherit (nixpkgs) lib;
inherit (nt) mix;
};
}