git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit02dfc07a045c628dfa718f075e7dbdf092b523f6 authorTristan Helmich (omniIT) <tristan.helmich@omniit.de> dateWed 14 Aug 2019, 09:22 (7 years ago) parent8746c77
1 file changed+2−2
nixos/modules/services/admin/oxidized.nix+2−2
nixos/modules/services/admin/oxidized.nix+2−2
@@ -97,8 +97,8 @@ in
9797
9898 preStart = ''
9999 mkdir -p ${cfg.dataDir}/.config/oxidized
100− cp -v ${cfg.routerDB} ${cfg.dataDir}/.config/oxidized/router.db
101− cp -v ${cfg.configFile} ${cfg.dataDir}/.config/oxidized/config
100+ ln -f -s ${cfg.routerDB} ${cfg.dataDir}/.config/oxidized/router.db
101+ ln -f -s ${cfg.configFile} ${cfg.dataDir}/.config/oxidized/config
102102 '';
103103
104104 serviceConfig = {