This commit is contained in:
stubdesu 2024-01-15 16:09:39 +07:00
parent 9272749b6f
commit 0f75981120
15 changed files with 129 additions and 31 deletions

43
hosts/anemone/default.nix Normal file
View file

@ -0,0 +1,43 @@
{ config, inputs, modules, overlays, pkgs, ... }: {
networking.hostName = "anemone";
system.stateVersion = "23.11";
time.timeZone = "Asia/Phnom_Penh";
nixpkgs.overlays = [ inputs.neovim-nightly.overlay ];
age.secrets = {
passwd.file = ../../secrets/passwd.age;
#wg_hyacinth.file = ../../secrets/wg_blossom.age;
#wpa_conf.file = ../../secrets/wpa_conf.age;
};
imports = with modules.system; [
inputs.home-manager.nixosModule
home-manager
audio
base
ccache
corectrl
flatpak
greetd
gui
input
kernel
nix
packages
printing
security
snapper
#wireguard
./filesystem.nix
./kernel.nix
./networking.nix
../../users/rin
];
# For steam fhs-env
nixpkgs.config.permittedInsecurePackages = [
"openssl-1.1.1w"
];
}

View file

@ -0,0 +1,36 @@
{ config, lib, ... }:
let
mkLabelMount = label: type: {
device = "/dev/disk/by-label/${label}";
fsType = type;
options = [ "defaults" "relatime" ];
};
mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" // {
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
};
submount = mkBtrfsMount "Anemone";
in
{
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=8G" "mode=755" ];
};
"/boot" = mkLabelMount "SYSTEM" "vfat";
"/mnt/butter" = submount "/" true;
"/nix" = submount "/current/snow" false;
"/home" = submount "/current/home" true;
"/home/.snapshots" = submount "/snapshot/home" false;
"/root" = submount "/current/root" false;
"/var" = submount "/current/var" false;
"/persist" = {
depends = [ "/var" ];
device = "/var/persist";
fsType = "none";
options = [ "bind" ];
neededForBoot = true;
};
};
}

14
hosts/anemone/kernel.nix Normal file
View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }: {
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
initrd.kernelModules = [ "amdgpu" ];
kernelModules = [ "kvm-amd" ];
kernelPackages = lib.mkForce (pkgs.linuxPackagesFor pkgs.me.linux-lava);
};
hardware.cpu.amd.updateMicrocode = true;
}

View file

@ -0,0 +1,12 @@
{ config, ... }: {
networking = {
useDHCP = true;
nameservers = [ "1.1.1.1" "8.8.8.8" ];
wireless.userControlled.enable = true;
extraHosts = ''
192.168.100.12 strawberry
192.168.100.15 caramel
'';
};
}