mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 13:29:15 +08:00
create current rootfs at boot
This commit is contained in:
parent
318e185217
commit
037add7ab3
@ -2,7 +2,6 @@ inputs:
|
||||
{
|
||||
config =
|
||||
{
|
||||
|
||||
# filesystem mount
|
||||
fileSystems =
|
||||
{
|
||||
@ -93,7 +92,24 @@ inputs:
|
||||
# initrd, luks
|
||||
boot.initrd =
|
||||
{
|
||||
systemd.enable = true;
|
||||
systemd =
|
||||
{
|
||||
enable = true;
|
||||
services.create-current-rootfs =
|
||||
{
|
||||
wantedBy = [ "cryptsetup.target" ];
|
||||
after = [ "cryptsetup.target" ];
|
||||
before = [ "local-fs.target" ];
|
||||
unitConfig.DefaultDependencies = false;
|
||||
serviceConfig.Type = "oneshot";
|
||||
script =
|
||||
''
|
||||
mount /dev/mapper/root /mnt -m
|
||||
btrfs subvolume create /mnt/nix/rootfs/current
|
||||
unmount /mnt
|
||||
'';
|
||||
};
|
||||
};
|
||||
# modules in initrd
|
||||
# modprobe --show-depends
|
||||
availableKernelModules =
|
||||
|
Loading…
Reference in New Issue
Block a user