summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index df5fe9b..e5c91dc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -8,8 +8,28 @@
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
+ packages.databaseImage = pkgs.dockerTools.buildImage {
+ name = "bridge-database";
+ contents = [ pkgs.shadow pkgs.postgresql_12 pkgs.bashInteractive pkgs.busybox ];
+ tag = "latest";
+
+ runAsRoot = ''
+ #!${pkgs.stdenv.shell}
+ ${pkgs.dockerTools.shadowSetup}
+ useradd postgres
+ mkdir -p /var/lib/postgres
+ chown postgres /var/lib/postgres
+ su postgres -c 'initdb -D /var/lib/postgres/data'
+ '';
+
+ config = {
+ Cmd = [ "/bin/su" "postgres" "-c" "/bin/postgres -D /var/lib/postgres/data" ];
+ };
+ };
+
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
+ podman-compose
stdenv
postgresql
openssl