nix-config/modules/scripts/datepath.nix

27 lines
468 B
Nix
Raw Normal View History

{ 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}))
];
};
}