feat: start migrating things

This commit is contained in:
Kat Inskip 2022-12-03 19:51:56 +01:00
parent d0b95b4b9e
commit ed581ca5b4
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
8 changed files with 530 additions and 9 deletions

19
nixos/modules/server.nix Normal file
View file

@ -0,0 +1,19 @@
{ config, lib, ... }: let
inherit (lib.options) mkOption mdDoc;
inherit (lib.modules) mkIf;
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.types) bool;
in {
options = {
role.server = mkOption {
type = bool;
description = mdDoc "Is this system's role a server?";
default = false;
};
};
config = mkIf config.role.server {
# Prevent services from being automatically killed on log-out
# https://wiki.archlinux.org/title/systemd/User#Automatic_start-up_of_systemd_user_instances
systemd.tmpfiles.rules = mapAttrsToList (username: _: "f /var/lib/systemd/linger/${username}" ) config.users.users;
};
}