Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 12 additions & 2 deletions docs/start/install/nix.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ in {

Re-apply your home-manager configuration the usual way (e.g. `home-manager switch`).

You will then have an `emanote` command in your profile, and a systemd
user service running a live-preview of your notes.
You will then have an `emanote` command in your profile, and a background
service running a live-preview of your notes (systemd on Linux, launchd on macOS).

On Linux:
```sh
$ home-manager switch
...
Expand All @@ -62,5 +63,14 @@ $ systemctl --user status emanote.service
└─1705303 /nix/store/9hj2cwk1jakfws0d1hpwa221kcni3j45-emanote-0.3.12.1/bin/emanote --layers /nix/store/hr7wp1xvqn48b8gy16sdq6k2csrvr8c1-emanote-config;/home/user/notes
```

On macOS:
```sh
$ home-manager switch
...
$ launchctl list | grep emanote
- 0 org.nix-community.home.emanote
$ tail ~/Library/Logs/emanote.log
```

[home-manager]: https://nixos.asia/en/home-manager
[module]: https://github.com/srid/emanote/blob/master/nix/modules/home/emanote.nix
1 change: 1 addition & 0 deletions emanote/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- UI revamp (#622)
- Dark mode (#605, #617)
- Mermaid: add `elk` layout (#618)
- Home Manager module: macOS support via launchd (#623)

## 1.4.0.0 (2025-08-18)

Expand Down
20 changes: 19 additions & 1 deletion nix/modules/home/emanote.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ in
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];

systemd.user.services.emanote = {
systemd.user.services.emanote = lib.mkIf pkgs.stdenv.isLinux {
Unit = {
Description = "Emanote web server";
PartOf = [ cfg.systemdTarget ];
Expand All @@ -115,5 +115,23 @@ in
'';
};
};

launchd.agents.emanote = lib.mkIf pkgs.stdenv.isDarwin {
enable = true;
config = {
ProgramArguments = [
"${pkgs.lib.getExe cfg.package}"
"--layers"
"${lib.concatStringsSep ";" layers}"
"run"
"--host=${cfg.host}"
"--port=${builtins.toString cfg.port}"
];
KeepAlive = true;
RunAtLoad = true;
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/emanote.log";
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/emanote.log";
};
};
};
}