templates: move machine templates
This commit is contained in:
18
templates/machine/flash-installer/configuration.nix
Normal file
18
templates/machine/flash-installer/configuration.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
config,
|
||||
clan-core,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./disko.nix
|
||||
clan-core.nixosModules.installer
|
||||
clan-core.clanModules.trusted-nix-caches
|
||||
clan-core.clanModules.disk-id
|
||||
clan-core.clanModules.iwd
|
||||
];
|
||||
|
||||
nixpkgs.pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
system.stateVersion = config.system.nixos.release;
|
||||
}
|
||||
54
templates/machine/flash-installer/disko.nix
Normal file
54
templates/machine/flash-installer/disko.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
suffix = config.clan.core.vars.generators.disk-id.files.diskId.value;
|
||||
in
|
||||
{
|
||||
boot.loader.grub.efiSupport = lib.mkDefault true;
|
||||
boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true;
|
||||
disko.devices = {
|
||||
disk = {
|
||||
"main" = {
|
||||
name = "main-" + suffix;
|
||||
type = "disk";
|
||||
device = lib.mkDefault "/dev/null";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
"boot" = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
priority = 1;
|
||||
};
|
||||
"ESP" = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
end = "-0";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "f2fs";
|
||||
mountpoint = "/";
|
||||
extraArgs = [
|
||||
"-O"
|
||||
"extra_attr,inode_checksum,sb_checksum,compression"
|
||||
];
|
||||
# Recommendations for flash: https://wiki.archlinux.org/title/F2FS#Recommended_mount_options
|
||||
mountOptions = [
|
||||
"compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime,nodiscard"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
7
templates/machine/new-machine/configuration.nix
Normal file
7
templates/machine/new-machine/configuration.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
|
||||
];
|
||||
|
||||
# New machine!
|
||||
}
|
||||
Reference in New Issue
Block a user