convoluted solution looking for a problem
unified modules structure
This commit is contained in:
parent
bf3946e06f
commit
1b7989336e
14 changed files with 61 additions and 44 deletions
49
modules/server.nix
Normal file
49
modules/server.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.my.server;
|
||||
in {
|
||||
options.my.server = {
|
||||
enable = lib.mkEnableOption "server role";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
# Enable the OpenSSH daemon.
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# PermitRootLogin = "no"; # this is managed through authorized keys
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
git.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
# ssh
|
||||
from = 22;
|
||||
to = 22;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
ncdu
|
||||
htop
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue