I want to convert this
builtins.readFile ../../dotfiles/vim/commands.vim + "\n" +
builtins.readFile ../../dotfiles/vim/keybindings.vim + "\n" +
builtins.readFile ../../dotfiles/vim/plugins.vim
into something more dynamic. This is what I've got so far. It evaluates to a list of strings.
map
( fileName: builtins.readFile ( ../../dotfiles/vim + "/${fileName}" )
( builtins.AttrNames ( builtins.readDir ../../dotfiles/vim ) )
With lib.concatStrings.
# Generic:
lib.concatStrings [ "a" "b" "c" ] # Returns "abc"
# Specific:
lib.concatStrings (
( map
( fileName: builtins.readFile ( ../../dotfiles/vim + "/${fileName}" )
( builtins.AttrNames ( builtins.readDir ../../dotfiles/vim ) )
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With