4 ms·
In Nix, you can do something like this: gitRef = with lib; pipe .git/HEAD [ readFile trim (splitString ":") last
by kissgyorgy 1y ago
In Nix, you can do something like this:
gitRef = with lib;
pipe .git/HEAD [
readFile
trim
(splitString ":")
last
trim
(ref: ./git/${ref})
readFile
trim
];
Super clean and cool!