hosts/anemone: init

This commit is contained in:
LavaDesu 2024-01-17 15:40:02 +07:00
parent 1ba66868be
commit 1700e735f6
Signed by: cilly
GPG key ID: 6500251E087653C9
5 changed files with 143 additions and 0 deletions

View file

@ -69,6 +69,7 @@
};
in
{
nixosConfigurations."anemone" = mkSystem nixpkgs "anemone" "x86_64-linux" true [];
nixosConfigurations."blossom" = mkSystem nixpkgs "blossom" "x86_64-linux" true [];
nixosConfigurations."hyacinth" = mkSystem nixpkgs "hyacinth" "x86_64-linux" true [];

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

@ -0,0 +1,44 @@
{ 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;
};
imports = with modules.system; [
inputs.home-manager.nixosModule
home-manager
audio
base
bluetooth
ccache
corectrl
flatpak
greetd
gui
input
kernel
nix
packages
printing
security
snapper
./filesystem.nix
./kernel.nix
./networking.nix
../../users/rin
];
programs.hyprland.enable = true;
# For steam fhs-env
nixpkgs.config.permittedInsecurePackages = [
"openssl-1.1.1w"
];
}

View file

@ -0,0 +1,36 @@
{ config, lib, ... }:
let
mkLabelMount = label: type: lazy: {
device = "/dev/disk/by-label/${label}";
fsType = type;
options = [ "defaults" "relatime" ] ++ lib.optionals lazy [ "nofail" ];
};
mkBtrfsMount = name: subvol: atime: mkLabelMount name "btrfs" false // {
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" true;
"/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;
};
};
}

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

@ -0,0 +1,47 @@
{ config, lib, pkgs, ... }: {
boot = {
consoleLogLevel = 0;
loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
};
initrd = {
availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
verbose = false;
};
kernelModules = [ "kvm-amd" ];
kernelPackages = lib.mkForce (pkgs.linuxPackagesFor pkgs.me.linux-lava);
kernelParams = [
"quiet"
"console=tty2"
"systemd.show_status=0"
"rd.systemd.show_status=0"
"rd.udev.log_level=3"
"udev.log_level=3"
"udev.log_priority=3"
];
};
hardware.cpu.amd.updateMicrocode = true;
hardware.firmware = let
fw = "${pkgs.linux-firmware}/lib/firmware/cirrus/";
in [(
pkgs.runCommandNoCC "cs35l41-10431683" { } ''
mkdir -p $out/lib/firmware/cirrus
cd $out/lib/firmware/cirrus
cp ${fw}/cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-cali-10431683-spkid0-l0.bin
cp ${fw}/cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-cali-10431683-spkid0-r0.bin
cp ${fw}/cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-cali-10431683-spkid1-l0.bin
cp ${fw}/cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-cali-10431683-spkid1-r0.bin
cp ${fw}/cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-prot-10431683-spkid0-l0.bin
cp ${fw}/cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-prot-10431683-spkid0-r0.bin
cp ${fw}/cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-prot-10431683-spkid1-l0.bin
cp ${fw}/cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin cs35l41-dsp1-spk-prot-10431683-spkid1-r0.bin
cp ${fw}/cs35l41-dsp1-spk-cali-10431e12.wmfw cs35l41-dsp1-spk-cali-10431683.wmfw
cp ${fw}/cs35l41-dsp1-spk-prot-10431e12.wmfw cs35l41-dsp1-spk-prot-10431683.wmfw
''
)];
}

View file

@ -0,0 +1,15 @@
{ config, ... }: {
networking = {
nameservers = [ "1.1.1.1" "8.8.8.8" ];
wireless.iwd.enable = true;
networkmanager = {
enable = true;
wifi.backend = "iwd";
};
extraHosts = ''
192.168.100.16 hyacinth
'';
};
}