Skip to content

Commit 6a02f40

Browse files
committed
Mount repositories on same path of host in lima instance
1 parent 0be8245 commit 6a02f40

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

config/lima/_config/default.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 🟢 Builtin default: [] (Mount nothing)
2+
mounts:
3+
# TODO: Disable default mounting host home to keep secure even if it is not writable
4+
# - location: '~' # Just comment out still respects template default. And setting mountPoint as false handles the false as string...
5+
- location: '~/repos' # See git.nix in this repo
6+
mountPoint: '{{.Home}}/repos' # Keep same behavior for ghq and the wrapped scripts
7+
writable: true # For developing purpose, writable should be reasonable. And my system does not directly include these files

home-manager/lima-host.nix

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
lima # includes qemu
1818
];
1919

20+
# Lima and the yaml config does not have importing feature. However it prefers some files to realize overriding.
21+
# See https://github.com/lima-vm/lima/blob/v1.0.1/templates/default.yaml#L536-L574 for detail
22+
file.".lima/_config/default.yaml".source = ../config/lima/_config/default.yaml;
23+
2024
activation = {
2125
# /tmp/lima will be writable shared by default of lima. However lima does not create the directory, and home-manager file module does not fit under /tmp.
2226
ensureLimaSharedTempdir = lib.hm.dag.entryAfter [ "writeBoundary" ] ''

0 commit comments

Comments
 (0)