remove nixpkgs dependency
YIPPIE YIPPIE YIPPIE
This commit is contained in:
parent
8dc975fc89
commit
dc37c482a8
4 changed files with 46 additions and 16 deletions
3
TODO.md
3
TODO.md
|
|
@ -13,6 +13,9 @@
|
||||||
- [X] rename nixos-modules/ to nixos/
|
- [X] rename nixos-modules/ to nixos/
|
||||||
- [X] ensure all machines are in groups.all by default
|
- [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
|
## Low Priority
|
||||||
- [ ] rename extraModules to modules?
|
- [ ] rename extraModules to modules?
|
||||||
- [ ] rename specialArgs to args?
|
- [ ] rename specialArgs to args?
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
self,
|
self,
|
||||||
this,
|
this,
|
||||||
nt,
|
nt,
|
||||||
lib,
|
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
|
@ -50,13 +49,8 @@
|
||||||
(nt.naive.terminal)
|
(nt.naive.terminal)
|
||||||
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 {
|
in {
|
||||||
|
base = null;
|
||||||
extraModules = [];
|
extraModules = [];
|
||||||
specialArgs = Terminal {};
|
specialArgs = Terminal {};
|
||||||
|
|
||||||
|
|
@ -188,8 +182,13 @@ in {
|
||||||
customOutputs = removeAttrs decl ["nexus"];
|
customOutputs = removeAttrs decl ["nexus"];
|
||||||
|
|
||||||
outputs = rec {
|
outputs = rec {
|
||||||
nixosConfigurations = mapNodes nexus.nodes (
|
nixosConfigurations = mapNodes nexus (
|
||||||
nodeName: node: let
|
{
|
||||||
|
lib,
|
||||||
|
nodeName,
|
||||||
|
node,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
nixosDecl = lib.nixosSystem {
|
nixosDecl = lib.nixosSystem {
|
||||||
system = node.system;
|
system = node.system;
|
||||||
specialArgs = let
|
specialArgs = let
|
||||||
|
|
@ -219,7 +218,11 @@ in {
|
||||||
nixosDecl
|
nixosDecl
|
||||||
);
|
);
|
||||||
|
|
||||||
deploy.nodes = mapNodes nexus.nodes (nodeName: node: let
|
deploy.nodes = mapNodes nexus ({
|
||||||
|
nodeName,
|
||||||
|
node,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit
|
inherit
|
||||||
(node.deploy)
|
(node.deploy)
|
||||||
activationTimeout
|
activationTimeout
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,12 @@ in rec {
|
||||||
(nt.naive.terminal)
|
(nt.naive.terminal)
|
||||||
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 {
|
in {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
system = "x86_64-linux"; # sane default (i hope...)
|
system = "x86_64-linux"; # sane default (i hope...)
|
||||||
|
|
@ -32,6 +38,8 @@ in rec {
|
||||||
extraModules = [];
|
extraModules = [];
|
||||||
specialArgs = Terminal {};
|
specialArgs = Terminal {};
|
||||||
|
|
||||||
|
base = null;
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
user = "root";
|
user = "root";
|
||||||
sudo = "sudo -u";
|
sudo = "sudo -u";
|
||||||
|
|
@ -67,7 +75,25 @@ in rec {
|
||||||
in
|
in
|
||||||
nt.projectOnto templateAttrs nodeAttrs;
|
nt.projectOnto templateAttrs nodeAttrs;
|
||||||
|
|
||||||
mapNodes = nodes: f:
|
mapNodes = nexus: f:
|
||||||
nodes
|
nexus.nodes
|
||||||
|> mapAttrs (nodeName: nodeAttrs: f nodeName (parseNode nodeName nodeAttrs));
|
|> 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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
systems.url = "github:nix-systems/default";
|
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";
|
nt.url = "github:cry128/nt";
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
|
|
@ -37,14 +37,12 @@
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
|
||||||
nt,
|
nt,
|
||||||
...
|
...
|
||||||
} @ inputs:
|
} @ inputs:
|
||||||
import ./cerulean
|
import ./cerulean
|
||||||
{
|
{
|
||||||
inherit inputs self nt;
|
inherit inputs self nt;
|
||||||
inherit (nixpkgs) lib;
|
|
||||||
inherit (nt) mix;
|
inherit (nt) mix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue