global: rename from faucet

This commit is contained in:
514fpv 2024-01-07 22:01:31 +08:00
parent f4d419eb0e
commit b75a0a482a
Signed by: koishi
SSH key fingerprint: SHA256:VkIdW3jUIiqecV2WNAje2fGU5lEhN0XZ58DN0NS4pv0
31 changed files with 40 additions and 40 deletions

29
global/boot/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.boot;
in {
options.global.boot = {
enable = mkEnableOption "bootloader installation and maintenance" // { default = true; };
systemd-boot = mkEnableOption "generation selection via systemd-boot" // { default = !cfg.lanzaboote; };
lanzaboote = mkEnableOption "secure boot maintenance via lanzaboote";
};
config = let
sbPath = "/nix/persist/lanzaboote";
in mkIf cfg.enable {
boot = {
initrd.systemd.enable = true;
lanzaboote.enable = cfg.lanzaboote;
lanzaboote.pkiBundle = sbPath;
loader.systemd-boot.enable = cfg.systemd-boot;
loader.efi.canTouchEfiVariables = true;
tmp.cleanOnBoot = true;
};
# symlink for sbctl
environment.etc.secureboot.source = sbPath;
environment.systemPackages = [ pkgs.sbctl ];
};
}