From 02dfc07a045c628dfa718f075e7dbdf092b523f6 Mon Sep 17 00:00:00 2001 From: "Tristan Helmich (omniIT)" Date: Wed, 14 Aug 2019 09:22:02 +0000 Subject: [PATCH] nixos/oxidized: Use symlinks for config files The old `cp` suffers from a permission issue on the 2nd start of the service. The files were copied from the read-only nix store. On the 2nd start of the service the `cp` failed. The new version force creates a symlink which does not suffer from this. --- nixos/modules/services/admin/oxidized.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/admin/oxidized.nix b/nixos/modules/services/admin/oxidized.nix index 687cdfb5ba57..39112c3970d5 100644 --- a/nixos/modules/services/admin/oxidized.nix +++ b/nixos/modules/services/admin/oxidized.nix @@ -97,8 +97,8 @@ in preStart = '' mkdir -p ${cfg.dataDir}/.config/oxidized - cp -v ${cfg.routerDB} ${cfg.dataDir}/.config/oxidized/router.db - cp -v ${cfg.configFile} ${cfg.dataDir}/.config/oxidized/config + ln -f -s ${cfg.routerDB} ${cfg.dataDir}/.config/oxidized/router.db + ln -f -s ${cfg.configFile} ${cfg.dataDir}/.config/oxidized/config ''; serviceConfig = {