Fix the X1 bootloader issue

This commit is contained in:
Sameer Rahmani 2024-04-21 14:13:21 +01:00
parent 374733e40f
commit d53cd1b0d8
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
5 changed files with 66 additions and 55 deletions

View File

@ -17,14 +17,14 @@ params:
rec { rec {
# A single nixos config outputting multiple formats. # A single nixos config outputting multiple formats.
# Alternatively put this in a configuration.nix. # Alternatively put this in a configuration.nix.
generator = {config, ...}: { generator = { config, ... }: {
imports = [ imports = [
params.nixos-generators.nixosModules.all-formats params.nixos-generators.nixosModules.all-formats
]; ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
# customize an existing format # customize an existing format
formatConfigs.iso = {config, ...}: { formatConfigs.iso = { config, ... }: {
services.openssh.enable = true; services.openssh.enable = true;
}; };
@ -32,19 +32,22 @@ rec {
git = import ./git; git = import ./git;
base = {config, lib, pkgs, inputs, ...}: base = { config, lib, pkgs, inputs, ... }:
let let
universePkg = pkgs.callPackage ../derivations/universe.nix {}; universePkg = pkgs.callPackage ../derivations/universe.nix { };
in { in
{
# point the system nixpkgs to this flake by indirecting through # point the system nixpkgs to this flake by indirecting through
# /etc so it changes when the system switches without having to # /etc so it changes when the system switches without having to
# restart all the terminals. thanks ElvishJerricco # restart all the terminals. thanks ElvishJerricco
nix.registry = builtins.mapAttrs (n: flake: { inherit flake; }) inputs; nix.registry = builtins.mapAttrs (n: flake: { inherit flake; }) inputs;
environment.etc = lib.mapAttrs' (name: flake: { environment.etc = lib.mapAttrs'
(name: flake: {
name = "nix/inputs/${name}"; name = "nix/inputs/${name}";
value.source = flake.outPath; value.source = flake.outPath;
}) inputs; })
inputs;
nix.nixPath = [ "/etc/nix/inputs" ]; nix.nixPath = [ "/etc/nix/inputs" ];
@ -190,7 +193,7 @@ rec {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
}; };
installerUser = {config, pkgs, ...}: { installerUser = { config, pkgs, ... }: {
users = { users = {
users.universe = { users.universe = {
password = "universe"; password = "universe";
@ -207,7 +210,7 @@ rec {
}; };
}; };
bootable = { lib, pkgs, ...}: { bootable = { lib, pkgs, ... }: {
boot = { boot = {
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
loader = { loader = {
@ -217,7 +220,7 @@ rec {
}; };
disk-installer = host: diskFile: { lib, pkgs, inputs, hostBuilderConfig, ... }: { disk-installer = host: diskFile: { lib, pkgs, inputs, hostBuilderConfig, ... }: {
imports = []; imports = [ ];
environment.systemPackages = [ environment.systemPackages = [
@ -265,10 +268,10 @@ rec {
boot.loader.grub.device = "nodev"; boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true; boot.loader.grub.efiSupport = true;
boot.loader.grub.efiInstallAsRemovable = true; boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true;
}; };
styles = { lib, pkgs, inputs, ...}: { styles = { lib, pkgs, inputs, ... }: {
imports = [ imports = [
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
@ -307,7 +310,7 @@ rec {
}; };
yubikey = { config, lib, pkgs, ...}: { yubikey = { config, lib, pkgs, ... }: {
services.pcscd.enable = true; services.pcscd.enable = true;
services.udev.packages = [ pkgs.yubikey-personalization ]; services.udev.packages = [ pkgs.yubikey-personalization ];
environment.systemPackages = [ environment.systemPackages = [
@ -315,6 +318,6 @@ rec {
]; ];
}; };
virtualisation = import ./virtualisation {}; virtualisation = import ./virtualisation { };
udev = import ./udev {}; udev = import ./udev { };
} }

View File

@ -25,12 +25,12 @@
;; Uncomment this line for debugging ;; Uncomment this line for debugging
;; (setq debug-on-error t) ;; (setq debug-on-error t)
(eval-when-compile (eval-when-compile
(defvar fg42/font nil)) (defvar fg42/config/font-size nil))
(setq fg42/font '("Fira Code" 10))
(when-wm (when-wm
(setq fg42/font '("Fira Code" 10))) (setq fg42/font/font-size 8))
(fg42/setup-font)
(provide '.fg42) (provide '.fg42)
;;; .fg42.el ends here ;;; .fg42.el ends here

View File

@ -77,6 +77,7 @@ in
{ {
installer = import ./installer.nix (params // { installer = import ./installer.nix (params // {
inherit host;
diskModule = (modules.disk-installer diskModule = (modules.disk-installer
host host
(if inVM then ./majin/vm.disk.nix else ./majin/disks.nix)); (if inVM then ./majin/vm.disk.nix else ./majin/disks.nix));

View File

@ -45,6 +45,8 @@ let
''; '';
fileSystems."/".neededForBoot = true; fileSystems."/".neededForBoot = true;
fileSystems."/boot/efi".neededForBoot = true;
services.gvfs.enable = true; services.gvfs.enable = true;
networking.firewall = { networking.firewall = {
@ -63,7 +65,11 @@ let
id = [ "24571728" "24571700" ]; id = [ "24571728" "24571700" ];
}; };
}; };
boot.loader.efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi"; # ← use the same mount point here.
};
boot.loader.grub.efiInstallAsRemovable = lib.mkForce false;
}; };
lxsameer = pkgs.callPackage ../users/lxsameer/default.nix { }; lxsameer = pkgs.callPackage ../users/lxsameer/default.nix { };
@ -76,6 +82,7 @@ in
{ {
installer = import ./installer.nix (params // { installer = import ./installer.nix (params // {
inherit host;
diskModule = (modules.disk-installer diskModule = (modules.disk-installer
host host
(if inVM then ./x1/vm.disk.nix else ./x1/disks.nix)); (if inVM then ./x1/vm.disk.nix else ./x1/disks.nix));

View File

@ -9,12 +9,12 @@
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
size = "1G"; size = "10M";
type = "EF00"; type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "vfat"; format = "vfat";
mountpoint = "/boot"; mountpoint = "/boot/efi";
}; };
}; };
swap = { swap = {