refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
205 changed files with 9040 additions and 342 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