From 646ca5c5ec2c2f7bbeb4fb286067db454c30dcf4 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Thu, 9 May 2024 16:08:29 +0200 Subject: [PATCH] Try to fix microbin permissions --- hosts/nixos/lapetus/services/microbin.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hosts/nixos/lapetus/services/microbin.nix b/hosts/nixos/lapetus/services/microbin.nix index 384011c..37d05f7 100644 --- a/hosts/nixos/lapetus/services/microbin.nix +++ b/hosts/nixos/lapetus/services/microbin.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, ... }: let port = 8418; in { @@ -10,7 +10,7 @@ in services.microbin = { enable = true; - dataDir = "/persist/state/var/lib/microbin"; + dataDir = "/var/lib/microbin"; # {{{ Settings settings = { @@ -32,5 +32,10 @@ in # }}} }; - systemd.tmpfiles.rules = [ "d ${config.services.microbin.dataDir}" ]; + systemd.services.microbin.serviceConfig = { + # We want to use systemd's `StateDirectory` mechanism to fix permissions + ReadWritePaths = lib.mkForce [ ]; + }; + + environment.persistence."/persist/state".directories = [ "/var/lib/microbin" ]; }