Skip to content

Commit

Permalink
modules: move all-hardware to bootstrap module
Browse files Browse the repository at this point in the history
  • Loading branch information
qbisi committed Oct 14, 2024
1 parent d06744a commit e214b7b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 21 deletions.
6 changes: 1 addition & 5 deletions devices/aarch64-linux/nixos-phytium-uefi-btrfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
, self
, ...
}:
let
system = "aarch64-linux";
in
{
nixpkgs.system = system;
nixpkgs.system = "aarch64-linux";

disko = {
memSize = 4096;
enableConfig = true;
profile.use = "btrfs";
profile.partLabel = "nvme";
};

hardware = {
Expand Down
7 changes: 2 additions & 5 deletions devices/aarch64-linux/nixos-rockchip-h88k-uboot-btrfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
, self
, ...
}:
let
system = "aarch64-linux";
in
{
nixpkgs.system = system;
nixpkgs.system = "aarch64-linux";

networking.hostName = lib.mkDefault "hinlink-h88k";

Expand Down Expand Up @@ -40,7 +37,7 @@ in

boot = {
kernelPackages = pkgs.linuxPackagesFor pkgs-self.linux_rkbsp_joshua;
initrd.availableKernelModules = lib.mkForce (lib.optional (config.disko.profile.partLabel == "usb") "uas");
initrd.availableKernelModules = lib.mkForce [];
kernelParams = [
"net.ifnames=0"
"console=tty1"
Expand Down
1 change: 0 additions & 1 deletion devices/aarch64-linux/nixos-rockchip-sw799-uboot-btrfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ in

boot = {
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = lib.optional (config.disko.profile.partLabel == "usb") "uas";
kernelParams = [
"net.ifnames=0"
"console=tty1"
Expand Down
2 changes: 0 additions & 2 deletions devices/x86_64-linux/nixos-x86_64-uefi-btrfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
{
nixpkgs.system = "x86_64-linux";

imports = [ "${modulesPath}/profiles/all-hardware.nix" ];

disko = {
enableConfig = true;
profile.use = "btrfs";
Expand Down
3 changes: 3 additions & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
};
bootstrap = { config, pkgs, modulesPath, ... }: {
imports = [
"${modulesPath}/profiles/all-hardware.nix"
./config/networking.nix
./system/grow-partition.nix
./config/passless.nix
];

boot.initrd.availableKernelModules = [ "mpt3sas" ];

environment.systemPackages = with pkgs; [
vim
grub2_efi
Expand Down
10 changes: 2 additions & 8 deletions modules/disko/profile.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ in
description = "disko preset profile to use";
};

platform = mkOption {
type = types.str;
default = config.nixpkgs.system;
description = "Device platform, use for image naming.";
};

enableBiosBoot = mkEnableOption "biosboot partition in gpt disk";

imageSize = mkOption {
Expand All @@ -36,12 +30,12 @@ in
imageName = mkOption {
type = types.str;
description = "name for the disk images";
default = "nixos-${cfg.platform}-${cfg.use}-${cfg.partLabel}";
default = "nixos-${config.nixpkgs.system}-${cfg.use}-${cfg.partLabel}";
};

partLabel = mkOption {
type = types.str;
default = "scsi";
default = "main";
example = "nvme";
description = ''
Disko use partlabel to identify and mount disk, use different partlabel
Expand Down

0 comments on commit e214b7b

Please sign in to comment.