Some massive changes to make flakiness better
Renamed the @inputs to @top. This was a misguided attempt to make a
different change, but it's going to stick, now.
Began moving packages to their own folder rather than being intermingled
with overlays
Created a local overlay that just includes my personal packages
Cleaned up some dead code
Moved to just using the raw 'imports' instead of needing to explicitly
call out the `foo = import foo.nix {};` syntax
This commit is contained in:
+40
-31
@@ -1,11 +1,18 @@
|
||||
{ config, lib, inputs, overlays, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
top,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.greg.containers;
|
||||
|
||||
# Create a container with all our default settings
|
||||
|
||||
makeContainer = _: container:
|
||||
makeContainer =
|
||||
_: container:
|
||||
let
|
||||
agekey = "/etc/ssh/agenix_key";
|
||||
in
|
||||
@@ -15,35 +22,38 @@ let
|
||||
localAddress = "192.168.${container.subnet}.2";
|
||||
privateNetwork = true;
|
||||
bindMounts = {
|
||||
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
|
||||
"${agekey}".hostPath = "/etc/ssh/ssh_host_ed25519_key"; # This is needed for agenix to
|
||||
};
|
||||
enableTun = container.tailscale;
|
||||
config = { ... }: {
|
||||
imports = [
|
||||
inputs.agenix.nixosModules.default
|
||||
inputs.self.modules.nixosModule
|
||||
container.builder
|
||||
];
|
||||
config =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
top.agenix.nixosModules.default
|
||||
top.self.modules.nixosModule
|
||||
container.builder
|
||||
];
|
||||
|
||||
nixpkgs.overlays = overlays;
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
networking = {
|
||||
firewall.enable = true;
|
||||
useHostResolvConf = lib.mkForce false;
|
||||
networking = {
|
||||
firewall.enable = true;
|
||||
useHostResolvConf = lib.mkForce false;
|
||||
};
|
||||
|
||||
age.identityPaths = [ agekey ];
|
||||
|
||||
greg.tailscale.enable = container.tailscale;
|
||||
};
|
||||
|
||||
age.identityPaths = [ agekey ];
|
||||
|
||||
greg.tailscale.enable = container.tailscale;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.greg.containers = lib.mkOption {
|
||||
default = { };
|
||||
|
||||
type = with lib.types; attrsOf (submodule (
|
||||
{
|
||||
type =
|
||||
with lib.types;
|
||||
attrsOf (submodule ({
|
||||
options = {
|
||||
tailscale = lib.mkOption {
|
||||
type = bool;
|
||||
@@ -57,20 +67,19 @@ in
|
||||
builder = lib.mkOption {
|
||||
default = { ... }: { };
|
||||
description = ''
|
||||
This needs to be a function, like the one for
|
||||
a container's config. It will setup the core system above the
|
||||
defaults set in this module.
|
||||
'';
|
||||
This needs to be a function, like the one for
|
||||
a container's config. It will setup the core system above the
|
||||
defaults set in this module.
|
||||
'';
|
||||
example = ''
|
||||
{ pkgs, config, lib, ... } :
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
'';
|
||||
{ pkgs, config, lib, ... } :
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
));
|
||||
}));
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
Reference in New Issue
Block a user