Restructure flake.nix for a simpler config for building different images off the same NixOS config.
This commit is contained in:
@@ -1,20 +1,30 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
22 # ssh
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
5353 # mDNS
|
||||
];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
options.me = {
|
||||
firewall.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install firewall.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.firewall.enable {
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
22 # ssh
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
5353 # mDNS
|
||||
];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user