-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,807 additions
and
134 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
inputs, | ||
cell, | ||
}: let | ||
inherit (inputs) hivelib colmena; | ||
|
||
nixpkgs = inputs.nixos; | ||
in { | ||
colmenaHive = cellBlock: self: let | ||
makeHoneyFrom = import ./make-honey.nix { | ||
inherit nixpkgs cellBlock colmena; | ||
}; | ||
in | ||
makeHoneyFrom self; | ||
|
||
nixosConfigurations = cellBlock: self: let | ||
makeMeadFrom = import ./make-mead.nix { | ||
inherit nixpkgs cellBlock; | ||
}; | ||
in | ||
makeMeadFrom self; | ||
|
||
darwinConfigurations = cellBlock: self: let | ||
makeDarwinFrom = import ./make-cider.nix { | ||
inherit nixpkgs cellBlock; | ||
darwin = inputs.darwin; | ||
}; | ||
in | ||
makeDarwinFrom self; | ||
|
||
homeConfigurations = cellBlock: self: let | ||
makeMoonshineFrom = import ./make-moonshine.nix { | ||
inherit nixpkgs cellBlock; | ||
}; | ||
in | ||
makeMoonshineFrom self; | ||
|
||
diskoConfigurations = cellBlock: self: let | ||
makeShantyFrom = import ./make-shanty.nix { | ||
inherit nixpkgs cellBlock; | ||
}; | ||
in | ||
makeShantyFrom self; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
nixpkgs, | ||
darwin, | ||
cellBlock ? "darwinConfigurations", | ||
}: let | ||
l = nixpkgs.lib // builtins; | ||
inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) cure beeOptions; | ||
in | ||
self: let | ||
comb = cure self; | ||
evalNode = extra: name: config: let | ||
in | ||
darwin.lib.darwinSystem { | ||
modules = | ||
[ | ||
extra | ||
config | ||
beeOptions | ||
] | ||
++ l.optionals (config.bee ? home) [ | ||
config.bee.home.darwinModules.home-manager | ||
]; | ||
inherit (config.bee) system pkgs; | ||
}; | ||
in | ||
l.mapAttrs (evalNode {}) comb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ colmena | ||
, nixpkgs | ||
, cellBlock ? "colmenaConfigurations" | ||
, | ||
}: | ||
let | ||
l = nixpkgs.lib // builtins; | ||
inherit (import ./pasteurize.nix { inherit nixpkgs cellBlock; }) pasteurize stir beeOptions; | ||
|
||
colmenaModules = [ | ||
colmena.nixosModules.assertionModule | ||
colmena.nixosModules.keyChownModule | ||
colmena.nixosModules.keyServiceModule | ||
colmena.nixosModules.deploymentOptions | ||
beeOptions # still present, but we dont care | ||
]; | ||
in | ||
self: | ||
let | ||
comb = pasteurize self; | ||
evalNode = extra: name: config: | ||
let | ||
inherit (stir config) evalConfig system; | ||
in | ||
evalConfig { | ||
inherit system; | ||
modules = colmenaModules ++ [ extra config ]; | ||
specialArgs = { inherit name; }; | ||
}; | ||
in | ||
# Exported attributes | ||
l.fix (this: { | ||
__schema = "v0"; | ||
|
||
nodes = l.mapAttrs (evalNode { _module.check = true; }) comb; | ||
toplevel = l.mapAttrs (_: v: v.config.system.build.toplevel) this.nodes; | ||
deploymentConfig = l.mapAttrs (_: v: v.config.deployment) this.nodes; | ||
deploymentConfigSelected = names: l.filterAttrs (name: _: l.elem name names) this.deploymentConfig; | ||
evalSelected = names: l.filterAttrs (name: _: l.elem name names) this.toplevel; | ||
evalSelectedDrvPaths = names: l.mapAttrs (_: v: v.drvPath) (this.evalSelected names); | ||
metaConfig = { | ||
name = "jz8132543/hive"; | ||
description = "Colmena deployment"; | ||
machinesFile = null; | ||
allowApplyAll = false; | ||
}; | ||
introspect = f: | ||
f { | ||
lib = nixpkgs.lib // builtins; | ||
pkgs = nixpkgs.legacyPackages.${builtins.currentSystem}; | ||
nodes = l.mapAttrs (evalNode { _module.check = false; }) comb; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
nixpkgs, | ||
cellBlock ? "nixosConfigurations", | ||
}: let | ||
l = nixpkgs.lib // builtins; | ||
inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) pasteurize stir beeOptions; | ||
in | ||
self: let | ||
comb = pasteurize self; | ||
evalNode = extra: name: config: let | ||
inherit (stir config) evalConfig system; | ||
in | ||
evalConfig { | ||
inherit system; | ||
modules = [ | ||
extra | ||
beeOptions | ||
config | ||
]; | ||
}; | ||
in | ||
l.mapAttrs (evalNode {}) comb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
nixpkgs, | ||
cellBlock ? "homeConfigurations", | ||
}: let | ||
l = nixpkgs.lib // builtins; | ||
inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) cure shake showAssertions; | ||
in | ||
self: let | ||
comb = cure self; | ||
res = name: config: let | ||
inherit | ||
(shake config {}) | ||
evaled | ||
; | ||
asserted = showAssertions evaled; | ||
in { | ||
# __schema = "v0"; | ||
inherit (asserted) options config; | ||
inherit (asserted.config.home) activationPackage; | ||
newsDisplay = evaled.config.news.display; | ||
newsEntries = l.sort (a: b: a.time > b.time) ( | ||
l.filter (a: a.condition) evaled.config.news.entries | ||
); | ||
}; | ||
in | ||
l.mapAttrs res comb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
nixpkgs, | ||
cellBlock ? "diskoConfigurations", | ||
}: let | ||
l = nixpkgs.lib // builtins; | ||
inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) sing; | ||
in | ||
sing |
Oops, something went wrong.