Skip to content

Commit 88acece

Browse files
committed
Fix pre-commit
Signed-off-by: Aleksandr Tserepov-Savolainen <aleksandr.tserepov-savolainen@unikie.com>
1 parent 057f801 commit 88acece

File tree

3 files changed

+51
-45
lines changed

3 files changed

+51
-45
lines changed

modules/reference/hardware/flake-module.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
inputs.self.nixosModules.hardware-aarch64-generic
148148
];
149149

150-
polarfire.imports = [ ./polarfire ];
151150
lenovo-x1-efi-uki = import ./lenovo-x1/definitions/lenovo-x1-efi-uki.nix;
152151

152+
polarfire.imports = [ ./polarfire ];
153153

154154
};
155155
# keep-sorted end
Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
# SPDX-FileCopyrightText: 2022-2026 TII (SSRC) and the Ghaf contributors
22
# SPDX-License-Identifier: Apache-2.0
33
#
4-
{ config, lib, pkgs, ... }:
4+
{
5+
config,
6+
lib,
7+
pkgs,
8+
...
9+
}:
510

611
let
712
inherit (lib) mkIf mkEnableOption;
813

914
cfg = config.ghaf.hardware.lenovo-x1-efi-uki;
1015

1116
# Kernel command line from config (no system.build.toplevel here to avoid recursion)
12-
kernelCmdline =
13-
lib.concatStringsSep " " config.boot.kernelParams;
14-
15-
ghafX1Uki = pkgs.runCommand "ghaf-x1-uki" {
16-
nativeBuildInputs = [ pkgs.systemdUkify ];
17-
} ''
18-
set -e
19-
echo "Building UKI for Lenovo X1 with config-based cmdline…"
20-
21-
mkdir -p "$out/EFI/BOOT"
22-
23-
# Provide an os-release file so ukify doesn't try /usr/lib/os-release
24-
cat > os-release <<'EOF'
25-
NAME="Ghaf"
26-
ID=ghaf
27-
PRETTY_NAME="Ghaf (Lenovo X1 UKI)"
28-
VERSION_ID="debug"
29-
EOF
30-
31-
"${pkgs.systemdUkify}/bin/ukify" build \
32-
--linux "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}" \
33-
--initrd "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" \
34-
--cmdline ${lib.escapeShellArg kernelCmdline} \
35-
--os-release=@os-release \
36-
--output "$out/EFI/BOOT/BOOTX64.EFI"
37-
38-
'';
39-
in {
40-
options.ghaf.hardware.lenovo-x1-efi-uki.enable =
41-
mkEnableOption "custom UKI for Lenovo X1";
17+
kernelCmdline = lib.concatStringsSep " " config.boot.kernelParams;
18+
19+
ghafX1Uki =
20+
pkgs.runCommand "ghaf-x1-uki"
21+
{
22+
nativeBuildInputs = [ pkgs.systemdUkify ];
23+
}
24+
''
25+
set -e
26+
echo "Building UKI for Lenovo X1 with config-based cmdline…"
27+
28+
mkdir -p "$out/EFI/BOOT"
29+
30+
# Provide an os-release file so ukify doesn't try /usr/lib/os-release
31+
cat > os-release <<'EOF'
32+
NAME="Ghaf"
33+
ID=ghaf
34+
PRETTY_NAME="Ghaf (Lenovo X1 UKI)"
35+
VERSION_ID="debug"
36+
EOF
37+
38+
"${pkgs.systemdUkify}/bin/ukify" build \
39+
--linux "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}" \
40+
--initrd "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" \
41+
--cmdline ${lib.escapeShellArg kernelCmdline} \
42+
--os-release=@os-release \
43+
--output "$out/EFI/BOOT/BOOTX64.EFI"
44+
45+
'';
46+
in
47+
{
48+
options.ghaf.hardware.lenovo-x1-efi-uki.enable = mkEnableOption "custom UKI for Lenovo X1";
4249

4350
config = mkIf cfg.enable {
4451
system.build.ghafX1Uki = ghafX1Uki;
4552

4653
boot.loader.systemd-boot.extraFiles = {
4754
"EFI/BOOT/BOOTX64.EFI" = "${ghafX1Uki}/EFI/BOOT/BOOTX64.EFI";
48-
"EFI/BOOT/test.lex" = "${ghafX1Uki}/EFI/BOOT/test.lex";
4955
};
5056
};
5157
}

targets/laptop/flake-module.nix

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ let
159159
}
160160
]))
161161

162+
(laptop-configuration "lenovo-x1-carbon-gen11-uki" "debug" (withCommonModules [
163+
self.nixosModules.hardware-lenovo-x1-carbon-gen11
164+
{
165+
ghaf = {
166+
hardware.lenovo-x1-efi-uki.enable = true;
167+
reference.profiles.mvp-user-trial.enable = true;
168+
partitioning.disko.enable = true;
169+
};
170+
}
171+
self.nixosModules.lenovo-x1-efi-uki
172+
]))
173+
162174
(laptop-configuration "lenovo-x1-carbon-gen12" "debug" (withCommonModules [
163175
self.nixosModules.hardware-lenovo-x1-carbon-gen12
164176
{
@@ -200,18 +212,6 @@ let
200212
}
201213
]))
202214

203-
(laptop-configuration "lenovo-x1-carbon-gen11-uki" "debug" (withCommonModules [
204-
self.nixosModules.hardware-lenovo-x1-carbon-gen11
205-
{
206-
ghaf = {
207-
hardware.lenovo-x1-efi-uki.enable = true;
208-
reference.profiles.mvp-user-trial.enable = true;
209-
partitioning.disko.enable = true;
210-
};
211-
}
212-
self.nixosModules.lenovo-x1-efi-uki
213-
]))
214-
215215
(laptop-configuration "system76-darp11-b" "debug" (withCommonModules [
216216
self.nixosModules.hardware-system76-darp11-b
217217
{

0 commit comments

Comments
 (0)