implement cerulean.nexus.nodes
This commit is contained in:
parent
decb028d19
commit
bb362d9470
2 changed files with 74 additions and 50 deletions
27
flake.lock
generated
27
flake.lock
generated
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756754095,
|
||||
"narHash": "sha256-9Rsn9XEWINExosFkKEqdp8EI6Mujr1gmQiyrEcts2ls=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7c815e513adbf03c9098b2bd230c1e0525c8a7f9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
85
flake.nix
85
flake.nix
|
|
@ -1,34 +1,85 @@
|
|||
{
|
||||
description = "Your Nix Cloud Simplified";
|
||||
|
||||
inputs = {
|
||||
inputs = let
|
||||
follows = following: {
|
||||
inputs = builtins.listToAttrs (builtins.map (x: {
|
||||
name = x;
|
||||
value = {follows = x;};
|
||||
})
|
||||
following);
|
||||
};
|
||||
in {
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
systems.url = "github:nix-systems/default";
|
||||
nib = {
|
||||
url = "github:emileclarkb/nib";
|
||||
inputs = follows ["systems"];
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
deploy-rs.url = "github:serokell/deploy-rs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
systems,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nib,
|
||||
deploy-rs,
|
||||
...
|
||||
}: let
|
||||
defaultSystems = ["aarch64-darwin" "aarch64-linux" "i686-linux" "x86_64-darwin" "x86_64-linux"];
|
||||
} @ inputs: let
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs defaultSystems (system:
|
||||
f system (import nixpkgs {
|
||||
inherit system;
|
||||
sys = with nib;
|
||||
mkUSys {
|
||||
pkgs = withPkgs nixpkgs {
|
||||
config.allowUnfree = false;
|
||||
overlays = builtins.attrValues self.overlays;
|
||||
}));
|
||||
in {
|
||||
overlays.default = final: prev: {
|
||||
};
|
||||
upkgs = withPkgs nixpkgs-unstable {
|
||||
config.allowUnfree = false;
|
||||
};
|
||||
};
|
||||
in rec {
|
||||
# overlays.default = final: prev: {
|
||||
# };
|
||||
|
||||
# checks = self.packages;
|
||||
# packages =
|
||||
# forAllSystems (system: pkgs: rec {
|
||||
# });
|
||||
|
||||
mkNexusConfig = config: let
|
||||
mapNodes = f: lib.mapAttrs f config.nexus.nodes;
|
||||
in rec {
|
||||
nixosConfigurations = mapNodes (
|
||||
name: node:
|
||||
lib.nixosSystem {
|
||||
system = node.system;
|
||||
modules = node.modules;
|
||||
}
|
||||
);
|
||||
|
||||
deploy.nodes = mapNodes (name: node: {
|
||||
hostname = name;
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = let
|
||||
system = node.system;
|
||||
in
|
||||
deploy-rs.lib.${system}.activate.nixos nixosConfigurations.${system};
|
||||
};
|
||||
});
|
||||
|
||||
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks deploy) deploy-rs.lib;
|
||||
};
|
||||
|
||||
checks = self.packages;
|
||||
packages =
|
||||
forAllSystems (system: pkgs: rec {
|
||||
});
|
||||
mkNexus = outputs: let
|
||||
config = outputs.cerulean;
|
||||
in
|
||||
(mkNexusConfig config) // (builtins.removeAttrs outputs ["cerulean"]);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue