add shared systemd module

This commit is contained in:
Rouven Seifert 2023-12-12 17:43:16 +01:00
parent 0ac9348fd2
commit 9e8e5053fd
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
4 changed files with 22 additions and 18 deletions

View file

@ -31,7 +31,6 @@
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
systemd.package = pkgs.systemd.override { withHomed = false; };
environment.systemPackages = with pkgs; [
vim
@ -58,6 +57,7 @@
enable = true;
settings.PasswordAuthentication = false;
};
services.journald.enableHttpGateway = true;
programs.mosh.enable = true;
security = {
audit.enable = true;

View file

@ -20,7 +20,6 @@
loader.efi.canTouchEfiVariables = true;
tmp.useTmpfs = true;
};
systemd.package = pkgs.systemd.override { withHomed = false; };
services.btrfs.autoScrub.enable = true;
environment.persistence."/nix/persist/system" = {
@ -61,6 +60,7 @@
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.journald.enableHttpGateway = true;
programs.mosh.enable = true;
security = {
audit.enable = true;

View file

@ -26,7 +26,7 @@
'';
tmp.useTmpfs = true;
};
systemd.package = pkgs.systemd.override { withHomed = false; };
# systemd.package = pkgs.systemd.override { withHomed = false; withUkify = true; };
environment.persistence."/nix/persist/system" = {
directories = [
@ -60,23 +60,9 @@
};
hardware.bluetooth.enable = true;
systemd.sleep.extraConfig = ''
HibernateDelaySec=2h
'';
services.mysql = {
enable = true;
package = pkgs.mariadb;
ensureUsers = [
{
name = "user1";
}
];
};
services.logind = {
lidSwitch = "suspend-then-hibernate";
lidSwitchDocked = "suspend-then-hibernate";
lidSwitchDocked = "suspend";
lidSwitchExternalPower = "suspend";
extraConfig = ''
HandlePowerKey = ignore

18
shared/systemd.nix Normal file
View file

@ -0,0 +1,18 @@
{ pkgs, lib, ... }:
{
systemd = {
package = lib.mkDefault (pkgs.systemd.override { withHomed = false; });
sleep.extraConfig = ''
HibernateDelaySec=2h
'';
oomd = {
enable = true;
enableSystemSlice = true;
enableRootSlice = true;
enableUserServices = true;
};
};
}