Lint files
This commit is contained in:
parent
d9c430135f
commit
10dc188e83
@ -1,8 +1,10 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.boot.loader.systemd-boot;
|
||||
|
||||
efi = config.boot.loader.efi;
|
||||
@ -10,7 +12,8 @@ let
|
||||
# We check the source code in a derivation that does not depend on the
|
||||
# system configuration so that most users don't have to redo the check and require
|
||||
# the necessary dependencies.
|
||||
checkedSource = pkgs.runCommand "systemd-boot" {
|
||||
checkedSource =
|
||||
pkgs.runCommand "systemd-boot" {
|
||||
preferLocalBuild = true;
|
||||
} ''
|
||||
install -m755 -D ${./systemd-boot-builder.py} $out
|
||||
@ -36,15 +39,22 @@ let
|
||||
|
||||
nix = config.nix.package.out;
|
||||
|
||||
timeout = if config.boot.loader.timeout == null then "menu-force" else config.boot.loader.timeout;
|
||||
timeout =
|
||||
if config.boot.loader.timeout == null
|
||||
then "menu-force"
|
||||
else config.boot.loader.timeout;
|
||||
|
||||
configurationLimit = if cfg.configurationLimit == null then 0 else cfg.configurationLimit;
|
||||
configurationLimit =
|
||||
if cfg.configurationLimit == null
|
||||
then 0
|
||||
else cfg.configurationLimit;
|
||||
|
||||
inherit (cfg) consoleMode graceful editor rebootForBitlocker;
|
||||
|
||||
inherit (efi) efiSysMountPoint canTouchEfiVariables;
|
||||
|
||||
bootMountPoint = if cfg.xbootldrMountPoint != null
|
||||
bootMountPoint =
|
||||
if cfg.xbootldrMountPoint != null
|
||||
then cfg.xbootldrMountPoint
|
||||
else efi.efiSysMountPoint;
|
||||
|
||||
@ -73,12 +83,14 @@ let
|
||||
${concatStrings (mapAttrsToList (n: v: ''
|
||||
${pkgs.coreutils}/bin/install -Dp "${v}" "${bootMountPoint}/"${escapeShellArg n}
|
||||
${pkgs.coreutils}/bin/install -D $empty_file "${bootMountPoint}/${nixosDir}/.extra-files/"${escapeShellArg n}
|
||||
'') cfg.extraFiles)}
|
||||
'')
|
||||
cfg.extraFiles)}
|
||||
|
||||
${concatStrings (mapAttrsToList (n: v: ''
|
||||
${pkgs.coreutils}/bin/install -Dp "${pkgs.writeText n v}" "${bootMountPoint}/loader/entries/"${escapeShellArg n}
|
||||
${pkgs.coreutils}/bin/install -D $empty_file "${bootMountPoint}/${nixosDir}/.extra-files/loader/entries/"${escapeShellArg n}
|
||||
'') cfg.extraEntries)}
|
||||
'')
|
||||
cfg.extraEntries)}
|
||||
'';
|
||||
};
|
||||
|
||||
@ -335,9 +347,10 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
assertions =
|
||||
[
|
||||
{
|
||||
assertion = (hasPrefix "/" efi.efiSysMountPoint);
|
||||
assertion = hasPrefix "/" efi.efiSysMountPoint;
|
||||
message = "The ESP mount point '${toString efi.efiSysMountPoint}' must be an absolute path";
|
||||
}
|
||||
{
|
||||
@ -356,7 +369,8 @@ in {
|
||||
assertion = cfg.installDeviceTree -> config.hardware.deviceTree.enable -> config.hardware.deviceTree.name != null;
|
||||
message = "Cannot install devicetree without 'config.hardware.deviceTree.enable' enabled and 'config.hardware.deviceTree.name' set";
|
||||
}
|
||||
] ++ concatMap (filename: [
|
||||
]
|
||||
++ concatMap (filename: [
|
||||
{
|
||||
assertion = !(hasInfix "/" filename);
|
||||
message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries within folders are not supported";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user