From 5eb5e446ade2854e966ba0f60067e3b153a7a119 Mon Sep 17 00:00:00 2001 From: coolneng Date: Sun, 26 Jan 2020 19:39:28 +0100 Subject: [PATCH] Add wallabag docker container --- configuration.nix | 4 +--- modules/containers.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 modules/containers.nix diff --git a/configuration.nix b/configuration.nix index bd84cf3..ea438f8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -92,9 +92,6 @@ programs.fish.enable = true; users.users.root.shell = "/run/current-system/sw/bin/fish"; - # Start a tmux session - #programs.tmux.enable = true; - # Import other configuration modules imports = [ ./modules/printing.nix @@ -103,6 +100,7 @@ ./modules/hardware-configuration.nix ./modules/webstack.nix ./modules/devops.nix + ./modules/containers.nix ]; } diff --git a/modules/containers.nix b/modules/containers.nix new file mode 100644 index 0000000..773c9ce --- /dev/null +++ b/modules/containers.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + + let password = builtins.readFile /var/lib/wallabag/token; + + in +{ + # Enable Docker + virtualisation.docker = { + enable = true; + storageDriver = "overlay2"; + }; + + # Container setup + docker-containers = { + wallabag = { + image = "decentralize/wallabag"; + environment = { + SYMFONY__ENV__DATABASE_DRIVER = "pdo_pgsql"; + SYMFONY__ENV__DATABASE_NAME = "wallabag"; + SYMFONY__ENV__DATABASE_USER = "wallabag"; + SYMFONY__ENV__DATABASE_PASSWORD = password; + SYMFONY__ENV__FOSUSER_REGISTRATION= "false"; + SYMFONY__ENV__DOMAIN_NAME= "https://coolneng.duckdns.org/wallabag"; + POPULATE_DATABASE = "false"; + }; + ports = [ "80:8081" ]; + }; + }; +}