A new start

This commit is contained in:
Harald Hoyer 2024-03-21 15:00:36 +01:00
commit f4e2368893
93 changed files with 7621 additions and 0 deletions

25
lib/file/default.nix Normal file
View file

@ -0,0 +1,25 @@
{ lib, ... }:
rec {
## Append text to the contents of a file
##
## ```nix
## fileWithText ./some.txt "appended text"
## ```
##
#@ Path -> String -> String
fileWithText = file: text: ''
${builtins.readFile file}
${text}'';
## Prepend text to the contents of a file
##
## ```nix
## fileWithText' ./some.txt "prepended text"
## ```
##
#@ Path -> String -> String
fileWithText' = file: text: ''
${text}
${builtins.readFile file}'';
}