lib: add fileContents function

+10
+10
lib/strings.nix
··· 479 479 absolutePaths = builtins.map (path: builtins.toPath (root + "/" + path)) relativePaths; 480 480 in 481 481 absolutePaths; 482 + 483 + /* Read the contents of a file removing the trailing \n 484 + 485 + Example: 486 + $ echo "1.0" > ./version 487 + 488 + fileContents ./version 489 + => "1.0" 490 + */ 491 + fileContents = file: removeSuffix "\n" (builtins.readFile file); 482 492 }