From 652a5fa04fa181c5842dc3f54a32f33db633ec92 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sun, 11 Feb 2024 13:16:43 +0100 Subject: [PATCH] Move postgres to shared module --- nixos-configurations/laptop/default.nix | 10 ---------- nixos-configurations/pc/default.nix | 9 --------- nixos-configurations/shared-desktop.nix | 11 ++++++++++- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/nixos-configurations/laptop/default.nix b/nixos-configurations/laptop/default.nix index 4c0f5d3..1cd40d7 100644 --- a/nixos-configurations/laptop/default.nix +++ b/nixos-configurations/laptop/default.nix @@ -10,16 +10,6 @@ networking.hostName = "laptop"; - services.postgresql = { - enable = true; - package = pkgs.postgresql_15; - ensureDatabases = [ "dcbot" "todos" ]; - authentication = pkgs.lib.mkOverride 10 '' - #type database DBuser auth-method - local all all trust - ''; - }; - home-manager.users.thiloho = { pkgs, ... }: { programs.git.signing.key = "1142F33FFA8ADAAC"; home = { diff --git a/nixos-configurations/pc/default.nix b/nixos-configurations/pc/default.nix index a88d843..d563526 100644 --- a/nixos-configurations/pc/default.nix +++ b/nixos-configurations/pc/default.nix @@ -32,15 +32,6 @@ dataDir = "/home/thiloho"; openDefaultPorts = true; }; - postgresql = { - enable = true; - package = pkgs.postgresql_15; - ensureDatabases = [ "dcbot" "todos" ]; - authentication = lib.mkForce '' - local all all trust - host all all ::1/128 trust - ''; - }; }; programs.adb.enable = true; diff --git a/nixos-configurations/shared-desktop.nix b/nixos-configurations/shared-desktop.nix index 538ec2e..bb0aea3 100644 --- a/nixos-configurations/shared-desktop.nix +++ b/nixos-configurations/shared-desktop.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { services = { @@ -20,6 +20,15 @@ enable = true; package = pkgs.mullvad-vpn; }; + postgresql = { + enable = true; + package = pkgs.postgresql_15; + ensureDatabases = [ "dcbot" "todos" ]; + authentication = lib.mkForce '' + local all all trust + host all all ::1/128 trust + ''; + }; }; networking.firewall = {