From c1845fe3477c4981ca95d2511410a84518021014 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 12 Sep 2025 08:50:28 +0100 Subject: [PATCH] Add `today` and `today2` scripts to print the ...current date Signed-off-by: Oliver Davies --- modules/scripts/today.nix | 26 ++++++++++++++++++++++++++ modules/scripts/today2.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 modules/scripts/today.nix create mode 100644 modules/scripts/today2.nix diff --git a/modules/scripts/today.nix b/modules/scripts/today.nix new file mode 100644 index 00000000..1abbee1f --- /dev/null +++ b/modules/scripts/today.nix @@ -0,0 +1,26 @@ +{ withSystem, ... }: + +let + name = "today"; +in +{ + perSystem = + { pkgs, ... }: + { + packages.${name} = pkgs.writeShellApplication { + inherit name; + + runtimeInputs = with pkgs; [ coreutils ]; + + text = ''date "+%x"''; + }; + }; + + flake.modules.homeManager.base = + { pkgs, ... }: + { + home.packages = [ + (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) + ]; + }; +} diff --git a/modules/scripts/today2.nix b/modules/scripts/today2.nix new file mode 100644 index 00000000..90a76c59 --- /dev/null +++ b/modules/scripts/today2.nix @@ -0,0 +1,26 @@ +{ withSystem, ... }: + +let + name = "today2"; +in +{ + perSystem = + { pkgs, ... }: + { + packages.${name} = pkgs.writeShellApplication { + inherit name; + + runtimeInputs = with pkgs; [ coreutils ]; + + text = ''date "+%F"''; + }; + }; + + flake.modules.homeManager.base = + { pkgs, ... }: + { + home.packages = [ + (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) + ]; + }; +}