mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-29 14:00:45 +00:00
Full rewrite
This commit is contained in:
parent
8053e16a12
commit
8dc12c0ae7
29 changed files with 294 additions and 74 deletions
5
system/services/default.nix
Normal file
5
system/services/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
_: {
|
||||
imports = [
|
||||
./ssh.nix
|
||||
];
|
||||
}
|
20
system/services/oomd.nix
Normal file
20
system/services/oomd.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ lib, ... }: {
|
||||
systemd = {
|
||||
# OOMd: Out Of Memory daemon
|
||||
# By default, this will only kill cgroups. So either systemd services
|
||||
# marked for killing uder OOM or (non-default, but enabled here) the entire user slice.
|
||||
oomd = {
|
||||
enable = true;
|
||||
enableSystemSlice = true;
|
||||
enableRootSlice = true;
|
||||
enableUserSlices = true;
|
||||
extraConfig = {
|
||||
"DefaultMemoryPressureDurationSec" = "20s";
|
||||
};
|
||||
};
|
||||
|
||||
# Make nix builds more likely to get killed than other important services.
|
||||
# The default for user slices is 100, and systemd-coredumpd is 500
|
||||
services.nix-daemon.serviceConfig.OOMScoreAdjust = lib.mkDefault 350;
|
||||
};
|
||||
}
|
12
system/services/ssh.nix
Normal file
12
system/services/ssh.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ ... }: {
|
||||
# TODO: This really shouldn't be a default service in system/
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
PasswordAuthentication = false;
|
||||
X11Forwarding = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue