summaryrefslogtreecommitdiffstats
path: root/modules/by-name/po
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/po')
-rw-r--r--modules/by-name/po/polkit/module.nix3
-rw-r--r--modules/by-name/po/postgresql/module.nix37
-rw-r--r--modules/by-name/po/power/module.nix29
3 files changed, 41 insertions, 28 deletions
diff --git a/modules/by-name/po/polkit/module.nix b/modules/by-name/po/polkit/module.nix
index c6d1c750..ae9dc775 100644
--- a/modules/by-name/po/polkit/module.nix
+++ b/modules/by-name/po/polkit/module.nix
@@ -17,7 +17,10 @@ in {
options.soispha.polkit = {
enable = lib.mkEnableOption "polkit";
};
+
config = lib.mkIf cfg.enable {
security.polkit.enable = true;
+
+ users.groups.polkituser.gid = config.vhack.constants.ids.gids.polkituser;
};
}
diff --git a/modules/by-name/po/postgresql/module.nix b/modules/by-name/po/postgresql/module.nix
index 5cdf6c77..ccc08b37 100644
--- a/modules/by-name/po/postgresql/module.nix
+++ b/modules/by-name/po/postgresql/module.nix
@@ -1,30 +1,39 @@
-# nixos-config - My current NixOS configuration
-#
-# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
-# SPDX-License-Identifier: GPL-3.0-or-later
-#
-# This file is part of my nixos-config.
-#
-# You should have received a copy of the License along with this program.
-# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
config,
lib,
+ pkgs,
...
}: let
- cfg = config.soispha.services.postgresql;
+ cfg = config.vhack.postgresql;
in {
- options.soispha.services.postgresql = {
+ options.vhack.postgresql = {
enable = lib.mkEnableOption "postgresql";
};
config = lib.mkIf cfg.enable {
- soispha.impermanence.directories = [
+ vhack.persist.directories = [
"/var/lib/postgresql"
];
- services.postgresql = {
- enable = true;
+ vhack.services.backup = {
+ exclude = [
+ "/var/lib/postgresql" # included in the db dump
+ ];
+
+ backupPrepare.postgresql = ''
+ ${lib.getExe pkgs.sudo} -u postgres \
+ ${lib.getExe' "pg_dumpall" pkgs.postgresql} \
+ --clean \
+ --if-exists \
+ --quote-all-identifiers |
+ ${lib.getExe pkgs.xz} \
+ --compress \
+ -9 \
+ --extreme \
+ --threads=0 > /srv/db_backup.sql.xz
+ '';
};
+
+ services.postgresql.enable = true;
};
}
diff --git a/modules/by-name/po/power/module.nix b/modules/by-name/po/power/module.nix
index 3489853c..5a547101 100644
--- a/modules/by-name/po/power/module.nix
+++ b/modules/by-name/po/power/module.nix
@@ -21,22 +21,23 @@ in {
config = lib.mkIf cfg.enable {
# see this for reference: https://github.com/NixOS/nixpkgs/issues/211345
services = {
- # conflicts with tlp
- power-profiles-daemon.enable = false;
-
- thermald.enable = true;
-
- tlp = {
+ tuned = {
enable = true;
- settings = {
- CPU_BOOST_ON_AC = 1;
- CPU_BOOST_ON_BAT = 0;
- CPU_SCALING_GOVERNOR_ON_AC = "performance";
- CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
- SATA_LINKPWR_ON_AC = "max_performance";
- SATA_LINKPWR_ON_BAT = "min_power";
- };
};
+
+ # thermald.enable = true;
+ #
+ # tlp = {
+ # enable = true;
+ # settings = {
+ # CPU_BOOST_ON_AC = 1;
+ # CPU_BOOST_ON_BAT = 0;
+ # CPU_SCALING_GOVERNOR_ON_AC = "performance";
+ # CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
+ # SATA_LINKPWR_ON_AC = "max_performance";
+ # SATA_LINKPWR_ON_BAT = "min_power";
+ # };
+ # };
};
};
}