Infini-SD: init

This commit is contained in:
Infinidoge 2024-02-27 03:04:12 -05:00
parent 2574b82458
commit 9d87b7d540
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
3 changed files with 91 additions and 0 deletions

View 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";
}

View 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;
};
};
}

View 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";
}