framework
This commit is contained in:
parent
42099d49b4
commit
aca4caf02c
17 changed files with 279 additions and 33 deletions
43
host/fw/default.nix
Normal file
43
host/fw/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
networking.hostName = "fw";
|
||||
|
||||
age.identityPaths = [
|
||||
"/root/.ssh/id_ed25519"
|
||||
];
|
||||
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
inputs.disko.nixosModules.disko
|
||||
./disko.nix
|
||||
];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
};
|
||||
};
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_6_12;
|
||||
kernel.sysctl."kernel.sysrq" = 1;
|
||||
|
||||
initrd.systemd.network.wait-online.enable = false;
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
cpuFreqGovernor = "ondemand";
|
||||
};
|
||||
|
||||
hd.desktop.enable = true;
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# ====== DON'T CHANGE ======
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
97
host/fw/disko.nix
Normal file
97
host/fw/disko.nix
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
let
|
||||
rootfs = {
|
||||
type = "btrfs";
|
||||
extraArgs = [
|
||||
"-f"
|
||||
"-L"
|
||||
"nixroot"
|
||||
];
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"/home" = {
|
||||
mountpoint = "/home";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"/nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
label = "crypt";
|
||||
content = {
|
||||
type = "luks";
|
||||
name = "cryptlvm";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "pool";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
lvm_vg = {
|
||||
pool = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
root = {
|
||||
size = "100%";
|
||||
content = rootfs;
|
||||
};
|
||||
swap = {
|
||||
size = "48G";
|
||||
content = {
|
||||
extraArgs = [ "-L nixswap" ];
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
28
host/fw/hardware-configuration.nix
Normal file
28
host/fw/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue