From 9e8e5053fd27b12d668995114958b0fdbbb15b6a Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Tue, 12 Dec 2023 17:43:16 +0100 Subject: [PATCH] add shared systemd module --- hosts/falkenstein/default.nix | 2 +- hosts/nuc/default.nix | 2 +- hosts/thinkpad/default.nix | 18 ++---------------- shared/systemd.nix | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 shared/systemd.nix diff --git a/hosts/falkenstein/default.nix b/hosts/falkenstein/default.nix index 1d4d18b..a7f2e86 100644 --- a/hosts/falkenstein/default.nix +++ b/hosts/falkenstein/default.nix @@ -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; diff --git a/hosts/nuc/default.nix b/hosts/nuc/default.nix index 7247b47..1ee4e45 100644 --- a/hosts/nuc/default.nix +++ b/hosts/nuc/default.nix @@ -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; diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index bae28e0..5f002cd 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -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 diff --git a/shared/systemd.nix b/shared/systemd.nix new file mode 100644 index 0000000..19f6ec1 --- /dev/null +++ b/shared/systemd.nix @@ -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; + }; + }; + +}