nixos-installer/lib/setup-scripts/default.nix

15 lines
549 B
Nix
Raw Normal View History

2022-05-09 13:20:43 +02:00
dirname: inputs: let
inherit (inputs.config) prefix;
inherit (import "${dirname}/../imports.nix" dirname inputs) getFilesExt;
2022-05-09 13:20:43 +02:00
replacePrefix = if prefix == "wip" then (x: x) else (builtins.mapAttrs (name: path: (
builtins.toFile name (builtins.replaceStrings
[ "@{config.wip." "@{#config.wip." "@{!config.wip." ]
[ "@{config.${prefix}." "@{#config.${prefix}." "@{!config.${prefix}." ]
(builtins.readFile path)
)
)));
in replacePrefix (getFilesExt "sh(.md)?" dirname)