From b0316ffe583a0411ab10c5b04bb67f4de28c2638 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Thu, 14 Nov 2024 19:23:08 +0100 Subject: [PATCH] files: add logging --- src/modules/files.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/files.nix b/src/modules/files.nix index 0e6b384ed..b7e77b797 100644 --- a/src/modules/files.nix +++ b/src/modules/files.nix @@ -75,8 +75,14 @@ let mkdir -p "${dirOf filename}" if [ -L "${filename}" ] then + echo "Overwriting ${filename}" ln -sf ${fileOption.file} "${filename}" + elif [ -f "${filename}" ] + then + echo "Conflicting file ${filename}" >&2 + exit 1 else + echo "Creating ${filename}" ln -s ${fileOption.file} "${filename}" fi '';