diff --git a/modules/scripts/datepath.nix b/modules/scripts/datepath.nix new file mode 100644 index 00000000..fa2b4e4d --- /dev/null +++ b/modules/scripts/datepath.nix @@ -0,0 +1,26 @@ +{ withSystem, ... }: + +let + name = "datepath"; +in +{ + perSystem = + { pkgs, ... }: + { + packages.${name} = pkgs.writeShellApplication { + inherit name; + + runtimeInputs = with pkgs; [ coreutils ]; + + text = ''date "+%4Y/%m/%d" "-d ''${*:-now}"''; + }; + }; + + flake.modules.homeManager.base = + { pkgs, ... }: + { + home.packages = [ + (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) + ]; + }; +}