Drive encryption (#11)
- Add drive encryption with luks - Refactor Hyprland binds - Refactor cache - Minor spelling fixes - Add firefox stylix profiles
This commit is contained in:
parent
32f0512ef5
commit
45954db37a
10 changed files with 334 additions and 292 deletions
|
|
@ -25,6 +25,18 @@
|
|||
Use swap in drive.
|
||||
'';
|
||||
};
|
||||
useEncryption = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
description = ''
|
||||
Enables encryption.
|
||||
!WARNING!
|
||||
You need your root drive to be named root exactly!
|
||||
Otherwise there will not be a root crypt!
|
||||
!WARNING!
|
||||
'';
|
||||
};
|
||||
homeAndRootFsTypes = lib.mkOption {
|
||||
default = "ext4";
|
||||
example = "btrfs";
|
||||
|
|
@ -149,6 +161,21 @@
|
|||
|
||||
config = (
|
||||
lib.optionalAttrs (options ? fileSystems) {
|
||||
boot.initrd.luks.devices = lib.mkIf (config.mods.drives.variant == "manual" && config.mods.drives.useEncryption) (
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
{
|
||||
name,
|
||||
drive,
|
||||
}: {
|
||||
cryptstorage.device = lib.mkIf (name != "root") drive?device;
|
||||
cryptoroot.device = lib.mkIf (name == "root") drive?device;
|
||||
}
|
||||
)
|
||||
config.mods.drives.extraDrives
|
||||
)
|
||||
);
|
||||
|
||||
fileSystems = lib.mkIf (config.mods.drives.variant == "manual" && !config.conf.wsl) (
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue