Skip to content
Merged
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
2 changes: 1 addition & 1 deletion home-manager/modules/paperclip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lib.mkIf host.isKyber {
};
Service = {
Type = "simple";
ExecStart = "${homeDir}/.bun/bin/bun run ${homeDir}/.bun/install/global/node_modules/paperclipai/dist/index.js run --no-repair";
ExecStart = "${homeDir}/.nix-profile/bin/bun run ${homeDir}/.bun/install/global/node_modules/paperclipai/dist/index.js run --no-repair";

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.

medium

Hardcoding the path to the bun binary in the user's profile (.nix-profile) is fragile and bypasses Nix's dependency tracking. A more robust and idiomatic approach in Home Manager is to use the bun package from pkgs directly (e.g., ${pkgs.bun}/bin/bun). This ensures that the binary is always available in the Nix store and correctly referenced by the service, regardless of the state of the user's profile. Note: To implement this, you will need to add pkgs to the module arguments at the top of the file (e.g., { config, lib, pkgs, inputs, ... }).

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

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

Using ${homeDir}/.nix-profile/bin/bun hard-codes a user profile symlink path that may not exist (or may differ) depending on how Home Manager/Nix is installed (e.g., profile locations, flakes, or non-standard per-user profiles). For a more reproducible unit, prefer referencing Bun via a Nix store path (e.g., lib.getExe pkgs.bun) and ensure Bun is provided by the module (e.g., added to home.packages or otherwise made available), rather than relying on ~/.nix-profile.

Copilot uses AI. Check for mistakes.
Restart = "always";
RestartSec = "5s";
Environment = [
Expand Down
Loading