Skip to content

Fix Home Manager module package default#685

Merged
srid merged 7 commits intomasterfrom
fix-home-manager-module-vm-test
Apr 29, 2026
Merged

Fix Home Manager module package default#685
srid merged 7 commits intomasterfrom
fix-home-manager-module-vm-test

Conversation

@srid
Copy link
Copy Markdown
Owner

@srid srid commented Apr 29, 2026

emanote.homeManagerModule now works without a manual package override, fixing the failure reported in #309. The flake-level Home Manager export supplies Emanote's own default package, while the reusable module keeps its plain pkgs.emanote default for non-flake imports.

The regression is covered by a Linux NixOS VM test flake under nix/home-manager-test. It imports emanote.homeManagerModule, enables the user service without setting services.emanote.package, waits for emanote.service, and confirms the local HTTP server responds. Vira builds this test flake directly and overrides its emanote input to the checked-out PR tree.

Notable details

  • The root flake does not gain a Home Manager input.
  • Home Manager is pinned only inside the standalone test flake and follows Emanote's nixpkgs.
  • vira.hs now builds both the root flake and ./nix/home-manager-test.
  • The Nix install docs now show package = ... as an optional override rather than a required workaround.

Verification

nix develop -c cabal build all
just fmt
nix build -L ./nix/home-manager-test --override-input emanote . --no-link

Closes #309.

Try it locally

nix build 'github:srid/emanote/fix-home-manager-module-vm-test?dir=nix/home-manager-test' \
  --override-input emanote github:srid/emanote/fix-home-manager-module-vm-test

Generated by /do on Codex (model gpt-5).

@srid
Copy link
Copy Markdown
Owner Author

srid commented Apr 29, 2026

Hickey/Lowy Analysis

# Reviewer Finding Disposition
1 Hickey Package default policy was fragmented between the generic Home Manager module and the flake export. Fixed in 9292ab48: the flake wrapper now supplies the self-backed default with lib.mkDefault, while the generic module keeps its pkgs.emanote default.
2 Lowy The package source leaked into the lower-level Home Manager module instead of staying at the flake boundary. No separate change: this was subsumed by the Hickey fix in 9292ab48.

The resulting boundary is intentionally narrow: direct imports of nix/modules/home/emanote.nix keep the old nixpkgs-oriented behavior, while emanote.homeManagerModule carries the flake-specific package default needed by issue #309.

@srid
Copy link
Copy Markdown
Owner Author

srid commented Apr 29, 2026

/do Results

Step Status Duration Verification
sync passed 1s git fetch ok; forge=github; noGit=false
research passed 5m 46s Issue #309 traced to nix/modules/home/emanote.nix defaulting to pkgs.emanote; planned self-backed module default plus Linux VM check.
branch passed 4s Created fix-home-manager-module-vm-test from origin/master.
implement passed 13m 18s Added self-backed homeManagerModule default, Linux VM check, and explicit root flake in vira.hs; VM check built successfully.
check passed 43s nix develop -c cabal build all passed.
docs passed 26s Updated Nix install docs and changelog.
fmt passed 10s just fmt passed.
commit passed 57s Created and pushed feature/docs commits.
hickey+lowy passed 5m 25s Fixed shared package-default boundary finding in 9292ab48; Lowy finding was subsumed by the same fix.
police passed 3m 8s Fixed missing release-check rationale comment; rules, fact-check, and elegance were clean afterward.
test passed 6s nix build -L .#checks.x86_64-linux.home-manager-module --no-link passed.
create-pr passed 38s Created draft PR #685 and posted Hickey/Lowy analysis.
ci passed 3m 31s vira ci passed; signed off vira/aarch64-darwin and vira/x86_64-linux.
evidence passed 0s No visible UI impact; PR evidence not required.
Total 36m 22s

Slowest step: implement at 13m 18s.

Process notes

The expensive part was iterating the VM service probe. Future NixOS VM tests like this should start with a bounded HTTP probe (curl --max-time) and an explicit user-systemd environment when checking user services from the test driver.

Comment thread vira.hs Outdated
@srid srid marked this pull request as ready for review April 29, 2026 21:37
@srid srid merged commit eaedf19 into master Apr 29, 2026
5 checks passed
@srid srid deleted the fix-home-manager-module-vm-test branch April 29, 2026 21:37
srid added a commit that referenced this pull request Apr 29, 2026
Brings in #685 (Home Manager module package default) and the agency
chore commit so this PR sits on top of latest master.

# Conflicts:
#	emanote/CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure to use homeManagerModule

1 participant