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:
Greg Hellings
2024-10-11 12:28:53 -05:00
parent d9a5f7968a
commit 8d752032ae
17 changed files with 355 additions and 288 deletions
+40 -31
View File
@@ -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 = {