Infini-SD: init
This commit is contained in:
parent
2574b82458
commit
9d87b7d540
3 changed files with 91 additions and 0 deletions
37
hosts/Infini-SD/default.nix
Normal file
37
hosts/Infini-SD/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ lib, ... }: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./filesystems.nix
|
||||
];
|
||||
|
||||
networking.hostId = "3275c7d3";
|
||||
|
||||
modules = {
|
||||
boot.grub.enable = true;
|
||||
hardware = {
|
||||
form.server = true;
|
||||
};
|
||||
};
|
||||
|
||||
persist = {
|
||||
directories = [
|
||||
"/home"
|
||||
"/etc/nixos"
|
||||
"/etc/nixos-private"
|
||||
|
||||
"/root/.local/share/nix"
|
||||
"/root/.ssh"
|
||||
|
||||
# /var directories
|
||||
"/var/log"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/var/lib/tailscale"
|
||||
];
|
||||
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
36
hosts/Infini-SD/filesystems.nix
Normal file
36
hosts/Infini-SD/filesystems.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
uuid = uuid: "/dev/disk/by-uuid/${uuid}";
|
||||
main = uuid "ae3f3d98-1d87-47b4-a4ed-d69a896eee69";
|
||||
commonOptions = [ "autodefrag" "noatime" "compress-force=zstd:4" ];
|
||||
|
||||
mkMain' = options: {
|
||||
device = main;
|
||||
fsType = "btrfs";
|
||||
options = commonOptions ++ options;
|
||||
};
|
||||
mkMain = options: (mkMain' options) // { neededForBoot = true; };
|
||||
in
|
||||
{
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "none";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=4G" "mode=755" ];
|
||||
};
|
||||
|
||||
"/media/main" = mkMain' [ ];
|
||||
|
||||
"/persist" = mkMain [ "subvol=root" ];
|
||||
"/etc/ssh" = mkMain [ "subvol=root/etc/ssh" ];
|
||||
"/nix" = mkMain [ "subvol=nix" ];
|
||||
"/boot" = mkMain [ "subvol=boot" ];
|
||||
|
||||
"/boot/efi" = {
|
||||
device = uuid "D7DB-2291";
|
||||
fsType = "vfat";
|
||||
neededForBoot = true;
|
||||
};
|
||||
};
|
||||
}
|
18
hosts/Infini-SD/hardware-configuration.nix
Normal file
18
hosts/Infini-SD/hardware-configuration.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "ahci" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ "usb_storage" ];
|
||||
boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelParams = [ "boot.shell_on_fail" ];
|
||||
boot.supportedFilesystems = [ "btrfs" "zfs" ];
|
||||
boot.zfs.forceImportRoot = false;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
|
||||
info.model = "Portable Installation";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue