-
-
Save betaboon/eb55984df0824e3fa73e8586444febff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ... }: { | |
boot.initrd.postDeviceCommands = '' | |
for o in $(cat /proc/cmdline); do | |
case $o in | |
nfsnixstore=*) | |
params="''${o#nfsnixstore=}" | |
nfsnixstore_mount=/nfs-nix-store | |
nfsnixstore_export=$(echo $params | cut -d, -f1) | |
nfsnixstore_options=$(echo $params | cut -d, -f2-) | |
echo "mounting $nfsnixstore_export with $nfsnixstore_options on $nfsnixstore_mount..." | |
mkdir -p $nfsnixstore_mount | |
mount -t nfs -o $nfsnixstore_options $nfsnixstore_export $nfsnixstore_mount | |
;; | |
esac | |
done | |
''; | |
fileSystems."/" = { | |
fsType = "tmpfs"; | |
options = [ "mode=0755" ]; | |
}; | |
fileSystems."/nix/.ro-store" = { | |
device = "../nfs-nix-store"; | |
options = [ "bind" ]; | |
neededForBoot = true; | |
}; | |
fileSystems."/nix/.rw-store" = { | |
fsType = "tmpfs"; | |
options = [ "mode=0755" ]; | |
neededForBoot = true; | |
}; | |
fileSystems."/nix/store" = { | |
fsType = "overlay"; | |
device = "overlay"; | |
options = [ | |
"lowerdir=/nix/.ro-store" | |
"upperdir=/nix/.rw-store/store" | |
"workdir=/nix/.rw-store/work" | |
]; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ systemctl list-dependencies dhcpcd.service | |
dhcpcd.service | |
● ├─system.slice | |
● ├─systemd-udev-settle.service | |
● ├─network.target | |
● │ ├─network-local-commands.service | |
● │ └─network-interfaces.target | |
● └─sysinit.target | |
● ├─dev-hugepages.mount | |
● ├─dev-mqueue.mount | |
● ├─kmod-static-nodes.service | |
● ├─sys-fs-fuse-connections.mount | |
● ├─sys-kernel-config.mount | |
● ├─sys-kernel-debug.mount | |
● ├─systemd-ask-password-console.path | |
● ├─systemd-journal-catalog-update.service | |
● ├─systemd-journal-flush.service | |
● ├─systemd-journald.service | |
● ├─systemd-modules-load.service | |
● ├─systemd-random-seed.service | |
● ├─systemd-sysctl.service | |
● ├─systemd-timesyncd.service | |
● ├─systemd-tmpfiles-setup.service | |
● ├─systemd-udev-trigger.service | |
● ├─systemd-udevd.service | |
● ├─systemd-update-done.service | |
● ├─systemd-update-utmp.service | |
● ├─local-fs.target | |
● │ ├─-.mount | |
● │ ├─nix-.ro\x2dstore.mount | |
● │ ├─nix-.rw\x2dstore.mount | |
● │ ├─nix-store.mount | |
● │ └─systemd-remount-fs.service | |
● └─swap.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ systemctl list-dependencies nix-.ro\\x2dstore.mount | |
nix-.ro\x2dstore.mount | |
● ├─-.mount | |
● ├─system.slice | |
● └─network-online.target | |
● └─dhcpcd.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ systemctl cat nix-.ro\\x2dstore.mount | |
# /run/systemd/generator/nix-.ro\x2dstore.mount | |
# Automatically generated by systemd-fstab-generator | |
[Unit] | |
Documentation=man:fstab(5) man:systemd-fstab-generator(8) | |
SourcePath=/etc/fstab | |
Before=local-fs.target | |
[Mount] | |
Where=/nix/.ro-store | |
What=../nfs-nix-store | |
Options=bind |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment