aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index b559c45..c113f40 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,11 +16,13 @@
pkg-config
openssl
gcc
+ glibc
];
packages.glitch-ng = naersk-lib.buildPackage {
pname = "glitch-ng";
root = ./.;
buildInputs = deps;
+ nativeBuildInputs = deps;
};
defaultPackage = packages.glitch-ng;
@@ -42,7 +44,8 @@
config = lib.mkIf config.services.glitch-ng.enable {
users.groups.glitch-ng = {
- members = [ "glitch-ng" ];
+ members = [ "glitch-ng"
+ "${config.services.postgresql.superUser}" ];
};
users.users.glitch-ng = {
createHome = true;
@@ -73,13 +76,15 @@
script = with pkgs; ''
if ! [ -e /var/lib/glitch-ng/.db-created ]; then
- runuser -u ${config.services.postgresql.superUser} -- ${config.services.postgresql.package}/bin/createuser glitch-ng
- runuser -u ${config.services.postgresql.superUser} -- ${config.services.postgresql.package}/bin/createdb -O glitch-ng glitch
+ ${config.services.postgresql.package}/bin/createuser glitch-ng
+ ${config.services.postgresql.package}/bin/createdb -O glitch-ng glitch
touch /var/lib/glitch-ng/.db-created
fi
'';
serviceConfig = {
Type = "oneshot";
+ User = "${config.services.postgresql.superUser}";
+ Group = "glitch-ng";
};
};