do things

This commit is contained in:
zack 2025-01-09 13:33:20 -05:00
parent 0dc849ff14
commit 5c08802127
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
14 changed files with 503 additions and 457 deletions

View file

@ -6,7 +6,7 @@
config,
...
}: {
imports = [./hardware-configuration.nix (import ./disko.nix {device = "/dev/nvme0n1";})];
imports = [./hardware-configuration.nix];
nix.settings = {
trusted-users = ["zoey"];
@ -46,11 +46,11 @@
services.fstrim.enable = true;
services.vpn.enable = true;
services.xserver.enable = true;
services.vpn.mullvad = true;
services.vpn.mullvad = false;
services.lorri.enable = true;
services.udisks2.enable = true;
services.transmission = {
enable = true;
enable = false;
package = pkgs.transmission_4;
settings = {
download-dir = "/home/zoey/dl";
@ -66,64 +66,13 @@
};
# Bootloader.
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.loader.systemd-boot.enable = true;
boot.lanzaboote = {
enable = true;
enable = false;
pkiBundle = "/etc/secureboot";
};
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/root_vg/root /btrfs_tmp
if [[ -e /btrfs_tmp/root ]]; then
mkdir -p /btrfs_tmp/old_roots
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
fileSystems."/persist".neededForBoot = true;
environment.persistence."/persist/system" = {
hideMounts = true;
directories = [
"/etc/nixos"
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
{
directory = "/var/lib/colord";
user = "colord";
group = "colord";
mode = "u=rwx,g=rx,o=";
}
];
files = [
"/etc/machine-id"
{
file = "/var/keys/secret_file";
parentDirectory = {mode = "u=rwx,g=,o=";};
}
];
};
networking.hostName = "earth"; # Define your hostname.
networking.extraHosts = "127.0.0.1 local-cald.io";
@ -149,18 +98,23 @@
pkgs.sbctl
pkgs.vesktop
pkgs.mangohud
pkgs.lutris
pkgs.podman-tui
pkgs.dive
pkgs.docker-compose
pkgs.podman-compose
pkgs.transmission_4
inputs.agenix.packages.${system}.agenix
inputs.awsvpnclient.packages."${pkgs.system}".awsvpnclient
];
programs.fish.enable = true;
programs.zsh.enable = true;
programs.fuse.userAllowOther = true;
users.users.zoey = {
isNormalUser = true;
description = "zoey";
extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "plugdev"];
shell = pkgs.fish;
shell = pkgs.zsh;
initialHashedPassword = "$6$rounds=2000000$rFBJH7LwdEHvv.0i$HdHorWqp8REPdWPk5fEgZXX1TujRJkMxumGK0f0elFN0KRPlBjJMW2.35A.ID/o3eC/hGTwbSJAcJcwVN2zyV/";
};
@ -180,7 +134,12 @@
sites.jellyfin.enable = true;
virtualisation.docker.enable = true;
virtualisation.containers.enable = true;
virtualisation.podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
virtualisation.libvirtd.enable = true;
system.stateVersion = "24.05";

View file

@ -1,73 +0,0 @@
{device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
disko.devices = {
disk.main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
swap = {
size = "4G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = ["subvol=persist" "noatime"];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = ["subvol=nix" "noatime"];
mountpoint = "/nix";
};
};
};
};
};
};
};
};
}

View file

@ -13,10 +13,25 @@
];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = ["dm-snapshot"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/ad6fa764-31b2-4dfd-9fc7-f2638c2e2e5e";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/AACF-2693";
fsType = "vfat";
options = ["fmask=0077" "dmask=0077"];
};
swapDevices = [
{device = "/dev/disk/by-uuid/5c74e955-26c7-4f71-9b48-975a89b1d5ec";}
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction