network: extract nixos module
This commit is contained in:
parent
7c8baf7f32
commit
c8fdfc2f3a
3 changed files with 24 additions and 12 deletions
|
@ -63,18 +63,6 @@
|
|||
# Enable trash:/// support
|
||||
services.gvfs.enable = true;
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
services.avahi.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
|
|
|
@ -13,6 +13,7 @@ in
|
|||
snowhawk.i18n.enable = lib.mkDefault true;
|
||||
snowhawk.audio.enable = lib.mkDefault true;
|
||||
snowhawk.env.enable = lib.mkDefault true;
|
||||
snowhawk.network.enable = lib.mkDefault true;
|
||||
snowhawk.sops.enable = lib.mkDefault true;
|
||||
snowhawk.power-button.enable = lib.mkDefault true;
|
||||
}
|
||||
|
|
23
modules/network.nix
Normal file
23
modules/network.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.snowhawk.network;
|
||||
in
|
||||
{
|
||||
options.snowhawk.network = {
|
||||
enable = lib.mkEnableOption "network nixos module";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
services.avahi.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue