Repository navigation
Struggleing with aspects settings #741
|
Hello, I'm migrating my config to Den and found the Aspect Settings thing pretty neat, so i configured and used it. In my den.aspects.security.base.measured-boot = { lib, ... }: {
settings.pcrs = lib.mkOption {
type = lib.types.listOf lib.types.enum [
"0" # UEFI firmware
"1" # UEFI configuration
"2" # GPT partition table
"3"
"4" # Bootloader
"7" # Secureboot state
];
default = [ "0" "1" "2" "4" "7" ];
description = "Set PCRs used for measured boot";
};
nixos = { .... };
};In the host declaration, i set: den.hosts.x86_64-linux.hermes = {
# ...
settings.security.base.measured-boot.pcrs = [ "0" "1" "2" "7" ]; # PCR 4 seems to not work on Framework 13
settings.kernel.flavor = "latest";
users = {
bastien = { };
};
};And it's imported in But when building my config, i get the following error: The weird thing is that i'm using (like in the docs) another setting in my I just can't get why it does not work, does someone have an idea ? Note that i'm not a Nix expect, so i may do some dumb things, even if i try to stick to the simple ones. Thanks |
Replies: 2 comments 3 replies
|
It seems you mixed name of the option with aspect name. |
|
Got it to work ! Thx @AlexLov for the help ! One may think that the parameter's name will be nested as much as the aspect it, but it isn't the case ! This won't work : { den, ... }: {
den.aspects.security.base.measured-boot = { lib, ... }: {
settings.pcrs = lib.mkOption {
type = lib.types.listOf (lib.types.enum [ 0 1 2 3 4 7 ]);
default = [ 0 1 2 4 7 ];
description = "Set PCRs used for measured boot";
};
};
den.aspects.laptop.includes = [
den.aspects.security.base.measured-boot
];
}
den.hosts.x86_64-linux.laptop = {
settings.security.base.measured-boot.pcrs = [ 0 1 2 7 ];
users = {
me = { };
};
};But this will : { den, ... }: {
den.aspects.measured-boot = { lib, ... }: {
settings.pcrs = lib.mkOption {
type = lib.types.listOf (lib.types.enum [ 0 1 2 3 4 7 ]);
default = [ 0 1 2 4 7 ];
description = "Set PCRs used for measured boot";
};
};
den.aspects.laptop.includes = [
den.aspects.security.base.measured-boot
];
}
den.hosts.x86_64-linux.laptop = {
settings.measured-boot.pcrs = [ 0 1 2 7 ];
users = {
me = { };
};
};Kinda sad that it does not works with nesting for better clarity |
Got it to work !
Thx @AlexLov for the help !
One may think that the parameter's name will be nested as much as the aspect it, but it isn't the case !
This won't work :
But this will :