Skip to content

meta: initial work on Hjem Standalone#153

Open
NotAShelf wants to merge 12 commits into
mainfrom
notashelf/push-vopmwnyulyoy
Open

meta: initial work on Hjem Standalone#153
NotAShelf wants to merge 12 commits into
mainfrom
notashelf/push-vopmwnyulyoy

Conversation

@NotAShelf

@NotAShelf NotAShelf commented May 25, 2026

Copy link
Copy Markdown
Member

I still haven't decided whether I want to do this in one go or in phases to build confidence as we go. As it stands, this PR provides the initial draft of the Hjem CLI I'm envisioning. As discussed on Matrix the CLI currently provides three invocation methods (hjem, hjem internal and hjem standalone) and acts as a replacement for pkgs.smfh, leveraging its library component after my latest refactor.

The CLI replaces a fair bit of NixOS and Darwin logic (primarily the Bash parts) and provides the necessary primitives for standalone, which (for the time being) include hjem standalone init, hjem standalone build, hjem standalone switch and a few other goodies (see --help). The CLI is not final, because I have not yet decided whether I like the subcommand approach. A much better way of doing this could be to allow symlinking the hjem binary as hjem-standalone and hjem-internal to make them do what their subcommands do and only that, i.e., don't leak hjem internal into pkgs.hjem when a standalone user only needs the standalone features. The names and design choices are all WIP, and feedback is welcome.

TODO

  • Cleanup NixOS module
  • Cleanup Darwin module
  • Update top-level.nix
    • Update linker option to default to hjem
  • VM Tests
  • Documentation
    • README
    • Manual

NotAShelf added 3 commits May 25, 2026 19:42
… CLI

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibfe8e6e81d47ad84e2b8ba19cd56a5d66a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4bad3c15e1b17934158855ec9e7b60cd6a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Id312294b08eed9a7556b20fba79b204b6a6a6964
@NotAShelf NotAShelf force-pushed the notashelf/push-vopmwnyulyoy branch from 357ed38 to f5904c9 Compare May 30, 2026 21:08
@NotAShelf NotAShelf marked this pull request as ready for review May 30, 2026 21:45
@NotAShelf NotAShelf requested a review from eclairevoyant as a code owner May 30, 2026 21:45
@NotAShelf

Copy link
Copy Markdown
Member Author

Ready for testing!

NotAShelf added 4 commits May 31, 2026 00:48
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Iae9c54337534833b8b4f04af3f0fba196a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Icf3fb9c85c069e8fdc84a32f2cfb943e6a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I37d216249d50a8dcdbf934ac32a62a3d6a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5e9cba24f86c0d17b4ee4a19738920206a6a6964
@NotAShelf NotAShelf force-pushed the notashelf/push-vopmwnyulyoy branch from 281df0d to aaacf6f Compare May 30, 2026 21:49
@Gerg-L

Gerg-L commented May 31, 2026

Copy link
Copy Markdown
Contributor

Workflow failure

May 30 21:51:57 node1 hjem-activate_-start[1294]: failed to copy '/nix/store/8ja5hly930fzyz75vkwl124fk9v7dhsm-hjem-manifests/manifest-alice.json' to '/var/lib/hjem/.hjem-manifest-1294.tmp': Permission denied (os error 13)

Damn permission issues

@eclairevoyant

eclairevoyant commented May 31, 2026

Copy link
Copy Markdown
Member

Standalone can't use /var/lib, it'd have to be its own state directory.
Like ~/.local/state or something.

@NotAShelf NotAShelf force-pushed the notashelf/push-vopmwnyulyoy branch 4 times, most recently from aa3d894 to b8a41c3 Compare May 31, 2026 10:56
NotAShelf added 4 commits May 31, 2026 13:57
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If4f2660fb8cad10bd359eb1e1f3fa9736a6a6964

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If4f2660fb8cad10bd359eb1e1f3fa9736a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idd34f0f1a17599a0b1587fe204c4c4396a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4ff3cf8b0ee815baf031dacdb6cc29e16a6a6964
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I61a9cb3c67be482f336e57ea060ca28e6a6a6964
@NotAShelf NotAShelf force-pushed the notashelf/push-vopmwnyulyoy branch from b8a41c3 to ed731e6 Compare May 31, 2026 10:57
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ic683208758b917195e51680c396595ac6a6a6964
@Gerg-L

Gerg-L commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

The only thing i see missing from the hjem cli is a uninstall command, which would be implemented by running smfh's deactivate on the most recent manifest, and then running the already implemented command CleanupState

however i don't think this is absolutely necessary to merge this


environment = {
systemPackages = [
(pkgs.callPackage ../cli/package.nix {})

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.

Suggested change
(pkgs.callPackage ../cli/package.nix {})
(pkgs.callPackage ../../cli/package.nix {})

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch ty. I should get rid of backwards imports altogether...

@eclairevoyant eclairevoyant Jun 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately if you don't use relative imports, you get rebuilds every time the flake changes. It's annoying, but this is the better option in most contexts.

@Gerg-L Gerg-L Jun 2, 2026

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.

@eclairevoyant https://github.com/Gerg-L/norebuild build both commits, no rebuild

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.

3 participants