A new start
This commit is contained in:
commit
f4e2368893
93 changed files with 7621 additions and 0 deletions
25
lib/file/default.nix
Normal file
25
lib/file/default.nix
Normal 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}'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue