From f2c8b5812ce946e2c3d9b35647f5ca544d6ec7a0 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 14 May 2020 19:13:36 +0300 Subject: [PATCH] feat: postgres adrielus role --- modules/applications/git/default.nix | 15 ++++++++++----- modules/applications/postgres.nix | 8 ++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/applications/git/default.nix b/modules/applications/git/default.nix index da599a1..44c322b 100644 --- a/modules/applications/git/default.nix +++ b/modules/applications/git/default.nix @@ -1,10 +1,15 @@ { pkgs, ... }: { home-manager.users.adrielus = { - home.packages = with pkgs; [ - gource - gitAndTools.hub - gitAndTools.git-secret - ]; + home.packages = with pkgs; + with gitAndTools; [ + # Render a git repo + gource + # Store secrets in github repos + git-secret + # Both of these are github clis + gh + hub + ]; programs.git = { enable = true; diff --git a/modules/applications/postgres.nix b/modules/applications/postgres.nix index 5255a00..c98b42f 100644 --- a/modules/applications/postgres.nix +++ b/modules/applications/postgres.nix @@ -11,5 +11,13 @@ host all all 127.0.0.1/32 trust host all all ::1/128 trust ''; + + initialScript = pkgs.writeText "backend-initScript" '' + CREATE ROLE adrielus WITH LOGIN PASSWORD '\' CREATEDB; + + # lunarbox db + CREATE DATABASE lunarbox; + GRANT ALL PRIVILEGES ON DATABASE lunarbox TO adrielus; + ''; }; }