initrd-ssh: Make /boot only accessible for root

This commit is contained in:
Simon Bruder 2023-12-31 13:23:20 +01:00
parent c5f5f6a5ca
commit abccb6f9e0
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -32,4 +32,10 @@
];
};
};
# This only works for vfat (EFI),
# for ext2 (MBR) it needs to be changed manually with chmod.
fileSystems."/boot".options = lib.mkIf
(config.boot.initrd.network.ssh.enable && config.fileSystems."/boot".fsType == "vfat")
(lib.mkDefault [ "umask=0077" ]);
}