mirror of
https://github.com/kaesaecracker/nixos-configuration.git
synced 2025-01-19 02:50:12 +01:00
34 lines
444 B
Nix
34 lines
444 B
Nix
|
{
|
||
|
config,
|
||
|
pkgs,
|
||
|
lib,
|
||
|
...
|
||
|
}: let
|
||
|
cfg = config.my.server;
|
||
|
in {
|
||
|
imports = [];
|
||
|
|
||
|
options.my.server = {
|
||
|
enable = lib.mkEnableOption "server role";
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf cfg.enable {
|
||
|
services = {
|
||
|
services.openssh.enable = true;
|
||
|
};
|
||
|
|
||
|
programs = {
|
||
|
};
|
||
|
|
||
|
networking.firewall = {
|
||
|
allowedTCPPortRanges = [
|
||
|
{
|
||
|
# ssh
|
||
|
from = 22;
|
||
|
to = 22;
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|