Merge pull request #139431 from erikarvstedt/etc-simplify-source

nixos/etc: simplify source path handling
This commit is contained in:
Robert Hensing 2021-10-03 00:50:39 +02:00 committed by GitHub
commit c3bf08d1b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,9 +6,7 @@ with lib;
let
# if the source is a local file, it should be imported to the store
localToStore = mapAttrs (name: value: if name == "source" then "${value}" else value);
etc' = map localToStore (filter (f: f.enable) (attrValues config.environment.etc));
etc' = filter (f: f.enable) (attrValues config.environment.etc);
etc = pkgs.runCommandLocal "etc" {
# This is needed for the systemd module
@ -55,7 +53,8 @@ let
mkdir -p "$out/etc"
${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
"makeEtcEntry"
etcEntry.source
# Force local source paths to be added to the store
"${etcEntry.source}"
etcEntry.target
etcEntry.mode
etcEntry.user