diff --git a/home/program/bash/default.nix b/home/program/bash/default.nix index 4caa4f1d..2e902b3b 100644 --- a/home/program/bash/default.nix +++ b/home/program/bash/default.nix @@ -15,7 +15,7 @@ let tgdata = secret.tg.dt "false"; tgdatasilent = secret.tg.dt "true"; - modulesRaw = pkgs.writeText "bash-user-modules-raw" (util.catContent (util.ls ./module)); + modulesRaw = pkgs.writeText "bash-user-modules-raw" (util.readFiles (util.ls ./module)); modulesFile = pkgs.replaceVars modulesRaw { inherit accent diff --git a/lib/Util.nix b/lib/Util.nix index 1275b372..132c0429 100644 --- a/lib/Util.nix +++ b/lib/Util.nix @@ -15,19 +15,22 @@ ls = path: map (f: "${path}/${f}") (builtins.attrNames (builtins.readDir path)); # Concat all files by `text` key. + # TODO: REMOVE catText = files: args: builtins.foldl' (acc: mod: acc + (import mod args).text) "" files; # Concat all file paths by `file` key. + # TODO: REMOVE catFile = files: args: builtins.foldl' (acc: mod: acc + (builtins.readFile (import mod args).file) + "\n") "" files; # Concat all files as a set. + # TODO: REMOVE catSet = files: args: builtins.foldl' (acc: mod: acc // mod) { } (map (file: import file args) files); # Concat all file contents. - catContent = files: builtins.foldl' (acc: mod: acc + (builtins.readFile mod) + "\n") "" files; + readFiles = files: builtins.foldl' (acc: mod: acc + (builtins.readFile mod) + "\n") "" files; # Systemd service that does not restart with system switch. mkStaticSystemdService = diff --git a/package/swayscript/default.nix b/package/swayscript/default.nix index 6c300850..c2f62c37 100644 --- a/package/swayscript/default.nix +++ b/package/swayscript/default.nix @@ -10,7 +10,7 @@ let notificationogg = ; shortogg = ; - raw = pkgs.writeText "swayscript-raw" (util.catContent (util.ls ./script)); + raw = pkgs.writeText "swayscript-raw" (util.readFiles (util.ls ./script)); script = pkgs.replaceVars raw { inherit pipewire