rescue boot

This commit is contained in:
Vivian 2022-10-08 21:38:55 +02:00
parent 743d86da5b
commit ebdbdacba4
6 changed files with 54 additions and 9 deletions

View file

@ -36,9 +36,7 @@ in {
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
virtualisation.podman = {
enable = true;
};
virtualisation.podman.enable = true;
# Additional packages
environment.systemPackages = with pkgs; [
@ -52,7 +50,6 @@ in {
nixpkgs-fmt
nixpkgs-review
ripgrep
rnix-lsp
rsync
tmux
vault

View file

@ -15,9 +15,6 @@ let vs = config.vault-secrets.secrets; in
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
networking.firewall.allowedTCPPorts = [ 80 443 ];
# needed as the mailserver configures its down DNS resolver

View file

@ -34,6 +34,7 @@ in {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./rescue-boot.nix
./networking.nix
];
@ -80,7 +81,7 @@ in {
kernelPackages = pkgs.linuxPackages_latest;
loader.systemd-boot.editor = false;
loader.systemd-boot.enable = true;
loader.systemd-boot.configurationLimit = 6;
# loader.systemd-boot.configurationLimit = 6;
loader.efi.canTouchEfiVariables = true;
loader.efi.efiSysMountPoint = "/boot/efi";
};
@ -89,6 +90,7 @@ in {
fileSystems."/".options = [ "compress=zstd" ];
fileSystems."/home".options = [ "compress=zstd" ];
fileSystems."/nix".options = [ "compress=zstd" "noatime" ];
# Filesystem dedup
services.beesd.filesystems = {

View file

@ -19,8 +19,20 @@
options = [ "subvol=@" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/d4f56e5b-2509-4e63-8324-65a35c71e90c";
fsType = "btrfs";
options = [ "subvol=@/nix" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/d4f56e5b-2509-4e63-8324-65a35c71e90c";
fsType = "btrfs";
options = [ "subvol=@home" ];
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/445C-AF67";
{ device = "/dev/disk/by-uuid/D478-6F66";
fsType = "vfat";
};

View file

@ -0,0 +1,33 @@
{ pkgs, ... }:
let
netboot = import (pkgs.path + "/nixos/lib/eval-config.nix") {
inherit (pkgs) system;
modules = [
(pkgs.path + "/nixos/modules/installer/netboot/netboot-minimal.nix")
module
];
};
module = {
system.stateVersion = "22.11";
boot.supportedFilesystems = [ "btrfs" "ext4" ];
environment.systemPackages = with pkgs; [
git
];
};
in {
boot.loader.systemd-boot = {
extraEntries = {
"rescue.conf" = ''
title Rescue Boot
linux /rescue-kernel
initrd /rescue-initrd
options init=${netboot.config.system.build.toplevel}/init ${toString netboot.config.boot.kernelParams}
'';
};
extraFiles = {
"rescue-kernel" = "${netboot.config.system.build.kernel}/bzImage";
"rescue-initrd" = "${netboot.config.system.build.netbootRamdisk}/initrd";
};
};
}

View file

@ -6,6 +6,10 @@
# use the latest Linux kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
environment.systemPackages = with pkgs; [
git
];
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
boot.supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];
}