Skip to content

Commit

Permalink
Fix how to register in home-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Nov 25, 2024
1 parent bc4196c commit 2adc9e8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions home-manager/lima-host.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@

home = {
activation = {
registerStartingLimaService = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${lib.getBin pkgs.lima}/bin/limactl start-at-login --enabled
'';
# Required to avoid missing systemctl in NixOS
# https://github.com/lima-vm/lima/blob/9248baf14a3208249ed38179cdd018ec288d1ef5/pkg/autostart/autostart.go#L91-L92
registerStartingLima =
if pkgs.stdenv.hostPlatform.isLinux then
(lib.hm.dag.entryBefore [ "reloadSystemd" ] ''
PATH="$PATH:${lib.getBin pkgs.systemd}/bin" run ${lib.getBin pkgs.lima}/bin/limactl start-at-login --enabled
'')
else
(lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${lib.getBin pkgs.lima}/bin/limactl start-at-login --enabled
'');
};
};
}

0 comments on commit 2adc9e8

Please sign in to comment.