fondue: init

This commit is contained in:
LavaDesu 2021-09-20 18:10:28 +07:00
parent eee9b5df5b
commit 2b4cb226a1
Signed by: cilly
GPG key ID: 6500251E087653C9
5 changed files with 83 additions and 0 deletions

23
hosts/fondue/default.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, modules, modulesPath, overlays, pkgs, ... }: {
networking.hostName = "fondue";
system.stateVersion = "21.05";
time.timeZone = "Australia/Melbourne";
imports = with modules.system; [
(modulesPath + "/profiles/qemu-guest.nix")
base
input
kernel
nix
packages
security
snapper
./filesystem.nix
./kernel.nix
./networking.nix
../../users/rin.nix
];
}

View file

@ -0,0 +1,28 @@
{ config, ... }:
let
mkMount = uuid: type: {
device = "/dev/disk/by-uuid/${uuid}";
fsType = type;
options = [ "defaults" "relatime" ];
};
mkBtrfsMount = subvolid: atime: mkMount "8253d2ea-0813-4f71-9968-553965f0054b" "btrfs" // {
options = [ "autodefrag" "compress=zstd:3" "defaults" "ssd" "ssd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")];
};
in
{
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ];
};
"/boot" = mkMount "0F35-9054" "vfat";
"/mnt/butter" = mkBtrfsMount 5 true;
"/nix" = mkBtrfsMount 258 false;
"/home" = mkBtrfsMount 260 true;
"/home/.snapshots" = mkBtrfsMount 262 false;
"/root" = mkBtrfsMount 261 false;
"/var" = mkBtrfsMount 259 false;
};
}

18
hosts/fondue/kernel.nix Normal file
View file

@ -0,0 +1,18 @@
{ config, pkgs, ... }: {
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
initrd = {
availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ];
kernelModules = [ "kvm-amd" ];
};
kernelPackages = pkgs.linuxPackages_latest;
};
}

View file

@ -0,0 +1,13 @@
{ config, ... }: {
networking = {
useDHCP = false;
interfaces.enp2s1.useDHCP = false;
interfaces.enp2s1.ipv4.addresses = [{
address = "192.168.100.101";
prefixLength = 24;
}];
defaultGateway = "192.168.100.1";
nameservers = [ "8.8.8.8" ];
};
}