Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Evaluate with nix-instantiate --eval --argstr date 'next friday' --option allow-unsafe-native-code-during-evaluation true --read-write-mode
{ date }:
with import <nixpkgs> {};
let
dateToEpochScript = writeScript "dateToEpoch" ''
#!${stdenv.shell}
date --date "$1" +%s
'';
in
builtins.exec [ dateToEpochScript date ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.