Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion home-manager/services/tokscale/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ let
pkgs.bash
pkgs.coreutils
];
activationPath = lib.concatStringsSep ":" [
"/run/wrappers/bin"
"/run/current-system/sw/bin"
(lib.makeBinPath [
pkgs.coreutils
pkgs.gawk
])
"/usr/bin"
"/bin"
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latent: crontab isn't Nix-provided in activationPath. The new PATH exposes /run/wrappers/bin, /run/current-system/sw/bin, pkgs.coreutils, pkgs.gawk, /usr/bin, and /bin — but no Nix package here provides crontab. This works today because the host provides it (NixOS setuid wrapper when services.cron.enable = true, or /usr/bin/crontab on non-NixOS Linux). If a user runs home-manager switch on a NixOS host without cron enabled, activation still fails with the existing command -v crontab error from activate-cron.sh:9-12 (no regression). Consider either (a) adding pkgs.cronie (or similar) to activationPath via lib.makeBinPath so activation is self-contained, or (b) documenting the host cron requirement in the module. Either way, the current PR is safe — this is purely a note about the reachability boundary.

# Every 3 hours, aligned to the wall clock.
calendarHours = [
0
Expand Down Expand Up @@ -55,7 +65,8 @@ in
# Linux (cron)
home.activation.installTokscaleCron = lib.mkIf pkgs.stdenv.isLinux (
config.lib.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD ${pkgs.bash}/bin/bash "${./activate-cron.sh}" ${lib.escapeShellArg cronCommand}
$DRY_RUN_CMD ${pkgs.coreutils}/bin/env PATH=${lib.escapeShellArg activationPath} \
${pkgs.bash}/bin/bash "${./activate-cron.sh}" ${lib.escapeShellArg cronCommand}
''
);
}
Loading