feat: modules
This commit is contained in:
29
nixos/module/hectic/hardware/hetzner-cloud.nix
Normal file
29
nixos/module/hectic/hardware/hetzner-cloud.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
inputs,
|
||||
flake,
|
||||
self,
|
||||
}:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hectic.hardware.hetzner-cloud;
|
||||
in {
|
||||
options.hectic.hardware.hetzner-cloud.enable = lib.mkEnableOption "Enable hetzner-cloud hardware configurations";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.initrd.availableKernelModules = [
|
||||
"ata_piix"
|
||||
"uhci_hcd"
|
||||
"xen_blkfront"
|
||||
] ++ (if pkgs.system != "aarch64-linux" then [ "vmw_pvscsi" ] else []);
|
||||
boot.initrd.kernelModules = ["nvme"];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/sda1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
};
|
||||
}
|
||||
37
nixos/module/hectic/hardware/lenovo-legion.nix
Normal file
37
nixos/module/hectic/hardware/lenovo-legion.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hectic.hardware.lenovo-legion;
|
||||
hasDisko = false;
|
||||
in {
|
||||
options.hectic.hardware.lenovo-legion = {
|
||||
enable = lib.mkEnableOption "Enable lenovo-legion hardware configurations";
|
||||
swapSize = lib.mkOption {
|
||||
type = lib.types.either (lib.types.enum [ "100%" ]) (lib.types.strMatching "[0-9]+[KMGTP]?");
|
||||
default = "0";
|
||||
description = ''
|
||||
Size of the partition, in sgdisk format.
|
||||
sets end automatically with the + prefix
|
||||
can be 100% for the whole remaining disk, will be done last in that case.
|
||||
'';
|
||||
};
|
||||
device = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "0";
|
||||
description = ''
|
||||
Size of the partition, in sgdisk format.
|
||||
sets end automatically with the + prefix
|
||||
can be 100% for the whole remaining disk, will be done last in that case.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user