apricot: init

This commit is contained in:
LavaDesu 2021-08-21 18:20:17 +07:00
parent a6a5c2cbca
commit 2917dcbe3b
Signed by: cilly
GPG key ID: 6500251E087653C9
5 changed files with 92 additions and 0 deletions

21
hosts/apricot/default.nix Normal file
View file

@ -0,0 +1,21 @@
{ config, modules, overlays, pkgs, ... }: {
networking.hostName = "apricot";
system.stateVersion = "21.05";
imports = with modules.system; [
base
input
kernel
nix
packages
security
snapper
./filesystem.nix
./kernel.nix
./networking.nix
../../users/rin.nix
];
}

View file

@ -0,0 +1,29 @@
{ config, ... }:
let
mkMount = uuid: type: {
device = "/dev/disk/by-uuid/${uuid}";
fsType = type;
options = [ "defaults" "relatime" ];
};
mkBtrfsMount = subvolid: atime: mkMount "c79ebe18-2d2b-4f0f-9940-afd9378afa09" "btrfs" // {
options = [ "autodefrag" "compress=zstd:3" "defaults" "nossd" "nossd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")];
};
in
{
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
"/boot" = mkMount "2818-A529" "vfat";
"/mnt/hdd" = mkMount "436ad832-8dcc-4813-b663-4d0b7b773ff2" "ext4";
"/mnt/butter" = mkBtrfsMount 5 true;
"/nix" = mkBtrfsMount 258 false;
"/home" = mkBtrfsMount 260 true;
"/home/.snapshots" = mkBtrfsMount 263 false;
"/root" = mkBtrfsMount 261 false;
"/var" = mkBtrfsMount 259 false;
};
}

18
hosts/apricot/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.kernelModules = [ "i915" ];
kernelParams = [
"intel_pstate=passive"
];
kernelPackages = pkgs.linuxPackages_latest;
};
}

View file

@ -0,0 +1,23 @@
{ config, ... }: {
networking = {
wireless = {
enable = true;
interfaces = [ "wlp1s0" ];
};
useDHCP = false;
interfaces.enp2s0.useDHCP = false;
interfaces.wlp1s0.useDHCP = false;
interfaces.enp2s0.ipv4.addresses = [{
address = "10.0.0.1";
prefixLength = 24;
}];
interfaces.wlp1s0.ipv4.addresses = [{
address = "192.168.100.14";
prefixLength = 24;
}];
defaultGateway = "192.168.100.1";
nameservers = [ "8.8.8.8" ];
};
}