lappy-gpt: inline nixos-generate logic for better boot consistency
this image boots!
This commit is contained in:
37
flake.lock
generated
37
flake.lock
generated
@@ -56,42 +56,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixlib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1636849918,
|
|
||||||
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixos-generators": {
|
|
||||||
"inputs": {
|
|
||||||
"nixlib": "nixlib",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1652457860,
|
|
||||||
"narHash": "sha256-fZZRON0geucxAFCEamzuZ5z4oj7xJj+6C9HWm1JY2n0=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixos-generators",
|
|
||||||
"rev": "11f97f971383d036159edd9221f1b3a60ed78c4f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixos-generators",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1629048390,
|
"lastModified": 1629048390,
|
||||||
@@ -156,7 +120,6 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mobile-nixos": "mobile-nixos",
|
"mobile-nixos": "mobile-nixos",
|
||||||
"nixos-generators": "nixos-generators",
|
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"pkgs-gitea": "pkgs-gitea",
|
"pkgs-gitea": "pkgs-gitea",
|
||||||
"pkgs-mobile": "pkgs-mobile"
|
"pkgs-mobile": "pkgs-mobile"
|
||||||
|
44
flake.nix
44
flake.nix
@@ -22,13 +22,9 @@
|
|||||||
url = "github:nix-community/home-manager/release-21.11";
|
url = "github:nix-community/home-manager/release-21.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixos-generators = {
|
|
||||||
url = "github:nix-community/nixos-generators";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, pkgs-gitea, pkgs-mobile, mobile-nixos, home-manager, nixos-generators }: {
|
outputs = { self, nixpkgs, pkgs-gitea, pkgs-mobile, mobile-nixos, home-manager }: {
|
||||||
nixosConfigurations.uninsane = self.decl-machine {
|
nixosConfigurations.uninsane = self.decl-machine {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
extraModules = [ ./uninsane ];
|
extraModules = [ ./uninsane ];
|
||||||
@@ -39,45 +35,19 @@
|
|||||||
extraModules = [ ./lappy ];
|
extraModules = [ ./lappy ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations.lappy-iso = self.decl-machine {
|
packages.x86_64-linux.lappy-gpt = let
|
||||||
system = "x86_64-linux";
|
image = nixpkgs.lib.nixosSystem {
|
||||||
extraModules = [
|
|
||||||
./lappy
|
|
||||||
"${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix"
|
|
||||||
({ pkgs, ...}: {
|
|
||||||
isoImage.isoName = "lappy-iso";
|
|
||||||
isoImage.makeEfiBootable = true;
|
|
||||||
isoImage.makeUsbBootable = true;
|
|
||||||
isoImage.edition = "minimal";
|
|
||||||
isoImage.squashfsCompression = "gzip";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations.lappy-sd = self.decl-machine {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
extraModules = [
|
|
||||||
./lappy
|
|
||||||
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image.nix"
|
|
||||||
({ pkgs, ...}: {
|
|
||||||
sdImage.imageName = "lappy-sd";
|
|
||||||
sdImage.compressImage = false;
|
|
||||||
sdImage.populateRootCommands = "";
|
|
||||||
sdImage.populateFirmwareCommands = "";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
packages.x86_64-linux.lappy-gpt = (nixos-generators.nixosGenerate {
|
|
||||||
pkgs = self.genpkgs.x86_64-linux.pkgs;
|
pkgs = self.genpkgs.x86_64-linux.pkgs;
|
||||||
|
system = "x86_64-linux";
|
||||||
specialArgs = { home-manager = home-manager; };
|
specialArgs = { home-manager = home-manager; };
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./lappy
|
./lappy
|
||||||
./modules
|
./modules
|
||||||
|
./image.nix
|
||||||
];
|
];
|
||||||
format = "raw-efi";
|
};
|
||||||
}).content;
|
in image.config.system.build.raw;
|
||||||
|
|
||||||
nixosConfigurations.pda = pkgs-mobile.lib.nixosSystem {
|
nixosConfigurations.pda = pkgs-mobile.lib.nixosSystem {
|
||||||
# inherit (self.genpkgs.aarch64-linux) pkgs;
|
# inherit (self.genpkgs.aarch64-linux) pkgs;
|
||||||
|
20
image.nix
Normal file
20
image.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
fileSystems."/" = {
|
||||||
|
# boot by label instead of unpredictable uuid
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
# make-disk-image only supports ext4
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
# fileSystems."/boot".device = "/dev/vda1";
|
||||||
|
fileSystems."/boot".device = "/dev/disk/by-label/ESP";
|
||||||
|
|
||||||
|
system.build.raw = import "${toString modulesPath}/../lib/make-disk-image.nix" {
|
||||||
|
inherit lib config pkgs;
|
||||||
|
partitionTableType = "efi";
|
||||||
|
fsType = config.fileSystems."/".fsType;
|
||||||
|
diskSize = "auto";
|
||||||
|
format = "raw";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@@ -6,6 +6,8 @@
|
|||||||
# find more of these with sensors-detect
|
# find more of these with sensors-detect
|
||||||
boot.kernelModules = [ "coretemp" "kvm-intel" ];
|
boot.kernelModules = [ "coretemp" "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelParams = [ "boot.shell_on_fail" ];
|
||||||
|
boot.consoleLogLevel = 7;
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
@@ -27,21 +29,17 @@
|
|||||||
pkgs.vaapiIntel
|
pkgs.vaapiIntel
|
||||||
];
|
];
|
||||||
|
|
||||||
# funky defaulting/forcing here because:
|
fileSystems."/" = lib.mkDefault {
|
||||||
# - we want to support image generation, where fs is defined by label instead of UUID
|
device = "/dev/disk/by-uuid/75230e56-2c69-4e41-b03e-68475f119980";
|
||||||
# - we want images to have btrfs roots, not ext4 default
|
fsType = "btrfs";
|
||||||
fileSystems."/" = {
|
options = [
|
||||||
device = lib.mkDefault "/dev/disk/by-uuid/75230e56-2c69-4e41-b03e-68475f119980";
|
|
||||||
fsType = lib.mkForce "btrfs";
|
|
||||||
options = lib.mkDefault [
|
|
||||||
"compress=zstd"
|
"compress=zstd"
|
||||||
"defaults"
|
"defaults"
|
||||||
];
|
];
|
||||||
autoResize = lib.mkForce false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = lib.mkDefault {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/BD79-D6BB";
|
device = lib.mkDefault "/dev/disk/by-uuid/BD79-D6BB";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user