From 6f4187b95e5498757d84d003053b20f092c1ad53 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 14 Oct 2024 09:48:33 +0100 Subject: [PATCH] new postgres connection dbui --- flake.lock | 8 ++++---- hosts/common/users/sam/default.nix | 9 +++++++++ hosts/semita/default.nix | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 822d684..420bfc8 100644 --- a/flake.lock +++ b/flake.lock @@ -427,11 +427,11 @@ }, "nix-secrets": { "locked": { - "lastModified": 1728676183, - "narHash": "sha256-zs7GE1hB5Jyjf+me5V6g9OkK+cHqRJeDe1BuTYHLVFs=", + "lastModified": 1728846526, + "narHash": "sha256-QgLj9RmR8wXCSNxQu4yJpUWG3fs74+RwkBzbTet/7nQ=", "ref": "refs/heads/master", - "rev": "25feeaad694df4e737e365fcee5f0783be94d3e9", - "revCount": 185, + "rev": "0a6c9a51bec90e47a577a7229f0519bdd8f0a914", + "revCount": 186, "type": "git", "url": "ssh://git@git.bitlab21.com/sam/nix-secrets.git" }, diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index b042d4d..8c743d9 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -3,6 +3,7 @@ inputs, config, lib, + configVars, ... }: let hostname = config.networking.hostName; @@ -10,6 +11,8 @@ sopsHashedPasswordFile = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."passwords/sam".path; secretsDirectory = builtins.toString inputs.nix-secrets; secretsFile = "${secretsDirectory}/secrets.yaml"; + baseddataPostgresIp = configVars.networking.addresses.postgres.ip; + baseddataPostgresPort = configVars.networking.addresses.postgres.port; username = "sam"; in { users.users.${username} = { @@ -55,6 +58,8 @@ in { "software/postgres/bitcoin/password" = {}; "software/postgres/bitcoin/ip" = {}; "software/postgres/bitcoin/username" = {}; + "software/postgres/baseddata/user_password" = {}; + "software/postgres/baseddata/user_username" = {}; "software/zotero/username" = {}; "software/zotero/password" = {}; "software/zotero/guid" = {}; @@ -85,6 +90,10 @@ in { { "url": "postgresql://${config.sops.placeholder."software/postgres/bitcoin/username"}:${config.sops.placeholder."software/postgres/bitcoin/password"}@${config.sops.placeholder."software/postgres/bitcoin/ip"}/bitcoin", "name": "bitcoin" + }, + { + "url": "postgresql://${config.sops.placeholder."software/postgres/baseddata/user_username"}:${config.sops.placeholder."software/postgres/baseddata/user_password"}@${baseddataPostgresIp}/baseddata", + "name": "baseddata" } ] ''; diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 3f7735c..a3175fc 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -137,6 +137,7 @@ in { programs.nix-ld.libraries = with pkgs; [ zlib # numpy libgcc # sqlalchemy + expat # pyosmium # that's where the shared libs go, you can find which one you need using # nix-locate --top-level libstdc++.so.6 (replace this with your lib) # ^ this requires `nix-index` pkg