Add weight and add-weight scripts
All checks were successful
/ check (push) Successful in 57s

Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
Oliver Davies 2025-09-17 21:59:33 +01:00
parent 6b1b1dddb9
commit 0141ca45f0
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{ withSystem, ... }:
let
name = "add-weight";
in
{
perSystem =
psArgs@{ pkgs, ... }:
{
packages.${name} = pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [
coreutils
psArgs.config.packages.today2
psArgs.config.packages.weight
];
text = ''
echo "$(today2),$1" >> "$XDG_DOCUMENTS_DIR/wiki/2-areas/health-fitness/weight.csv"
weight
'';
};
};
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
};
}

View file

@ -0,0 +1,28 @@
{ withSystem, ... }:
let
name = "weight";
in
{
perSystem =
{ pkgs, ... }:
{
packages.${name} = pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [
coreutils
];
text = ''tail "$XDG_DOCUMENTS_DIR/wiki/2-areas/health-fitness/weight.csv"'';
};
};
flake.modules.homeManager.base =
{ pkgs, ... }:
{
home.packages = [
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
];
};
}