From fa0b17eaac05ff10644b362e61be8b86045a1189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jun 2024 16:51:40 +0200 Subject: [PATCH] fix fake-etc build on machines without sandbox If we have no sandbox enabled or on macos with sandbox enabled, /etc contains a lot more files than we actually want. Instead of copying some random files, we now just create those files ourself. --- nixosModules/clanCore/facts/default.nix | 30 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/nixosModules/clanCore/facts/default.nix b/nixosModules/clanCore/facts/default.nix index 51a44a48..d7c98fed 100644 --- a/nixosModules/clanCore/facts/default.nix +++ b/nixosModules/clanCore/facts/default.nix @@ -118,19 +118,29 @@ defaultText = "read only script"; default = '' set -eu -o pipefail - + export PATH="${lib.makeBinPath config.path}:${pkgs.coreutils}/bin" - + # prepare sandbox user mkdir -p /etc - cp ${ - pkgs.runCommand "fake-etc" { } '' - export PATH="${pkgs.coreutils}/bin" - mkdir -p $out - cp /etc/* $out/ - '' - }/* /etc/ - + + cat > /etc/group < /etc/passwd < /etc/hosts <