add bridge on desktop1 and a test httpd container to test network
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./httpd.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
cfg = config.smayzy.containers.nixos.httpd;
|
||||
in
|
||||
{
|
||||
options.smayzy.containers.nixos.httpd = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "httpd nixos ct";
|
||||
};
|
||||
bridge = mkOption {
|
||||
type = types.str;
|
||||
description = "the bridge to use e.g. (br0)";
|
||||
};
|
||||
ip = mkOption {
|
||||
type = types.str;
|
||||
description = "ip addr e.g. (192.168.1.20)";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
containers.httpd = {
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostBridge = cfg.bridge;
|
||||
localAddress = cfg.ip;
|
||||
config = { ... }: {
|
||||
system.stateVersion = "25.11";
|
||||
|
||||
services.httpd = {
|
||||
enable = true;
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user