More movearounds and stuff idk anymore

This commit is contained in:
Jimbo 2024-11-05 05:49:14 -05:00
parent 9a30fae72f
commit 84d5732a32
13 changed files with 56 additions and 48 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: { config, pkgs, ... }:
let let
commonKernelParams = [ commonKernelParams = [
# Nvidia settings # Nvidia settings
@ -31,13 +31,13 @@ in {
services.root-reset = { services.root-reset = {
description = "Reset root and snapshot last boot"; description = "Reset root and snapshot last boot";
wantedBy = [ "initrd.target" ]; wantedBy = [ "initrd.target" ];
after = [ "dev-firefly-root.device" ]; after = [ "dev-${config.networking.hostName}-root.device" ];
before = [ "sysroot.mount" ]; before = [ "sysroot.mount" ];
unitConfig.DefaultDependencies = "no"; unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
mkdir -p /mnt mkdir -p /mnt
mount /dev/firefly/root /mnt mount /dev/${config.networking.hostName}/root /mnt
if [[ -e /mnt/prev ]]; then if [[ -e /mnt/prev ]]; then
btrfs subvolume delete /mnt/prev btrfs subvolume delete /mnt/prev

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { ... }:
{ {
imports = [ imports = [
./boot ./boot

View file

@ -1,10 +1,10 @@
{ disko, ... }: { disko, config, ... }:
{ {
imports = [ disko.nixosModules.disko ]; imports = [ disko.nixosModules.disko ];
disko.devices = { disko.devices = {
disk = { disk = {
firefly = { "${config.networking.hostName}" = {
type = "disk"; type = "disk";
device = "/dev/nvme0n1"; device = "/dev/nvme0n1";
content = { content = {
@ -29,7 +29,7 @@
passwordFile = "/tmp/secret.key"; passwordFile = "/tmp/secret.key";
content = { content = {
type = "lvm_pv"; type = "lvm_pv";
vg = "firefly"; vg = "${config.networking.hostName}";
}; };
}; };
}; };
@ -39,7 +39,7 @@
}; };
lvm_vg = { lvm_vg = {
firefly = { "${config.networking.hostName}" = {
type = "lvm_vg"; type = "lvm_vg";
lvs = { lvs = {
root = { root = {

View file

@ -21,22 +21,6 @@
}; };
fileSystems = { fileSystems = {
# Useful system mounts
"/etc/libvirt" = {
device = "/dev/disk/by-uuid/f18a0302-9914-471d-828c-85ab1a67a8be";
options = [ "nosuid" "nodev" "nofail" ];
};
"/etc/libvirt/VMs/Bulk" = {
depends = [ "/etc/libvirt" ];
device = "/dev/disk/by-uuid/3eb36c3e-81ac-4281-89f0-c89242d88dd6";
options = [ "nosuid" "nodev" "nofail" ];
};
"/var/lib/libvirt" = {
depends = [ "/etc/libvirt" ];
device = "/etc/libvirt/varlibvirt";
options = [ "bind" "rw" ];
};
# Games and such # Games and such
"/mnt/Linux1" = { "/mnt/Linux1" = {
device = "/dev/disk/by-uuid/b2901f8c-ffda-4b88-bb63-a9ea0c96ccb4"; device = "/dev/disk/by-uuid/b2901f8c-ffda-4b88-bb63-a9ea0c96ccb4";
@ -46,6 +30,10 @@
device = "/dev/disk/by-uuid/f08e4f38-162c-402f-ba2a-5925151b78bf"; device = "/dev/disk/by-uuid/f08e4f38-162c-402f-ba2a-5925151b78bf";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ]; options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
}; };
"/mnt/Linux3" = {
device = "/dev/disk/by-uuid/e7bc75bd-c371-4b28-b212-7be9b1fad339";
options = [ "nosuid" "nodev" "nofail" "x-gvfs-show" ];
};
"/mnt/Windows1" = { "/mnt/Windows1" = {
device = "/dev/disk/by-uuid/10BC97B2BC979138"; device = "/dev/disk/by-uuid/10BC97B2BC979138";
options = [ "nosuid" "nodev" "noauto" ]; options = [ "nosuid" "nodev" "noauto" ];
@ -55,6 +43,16 @@
options = [ "nosuid" "nodev" "noauto" ]; options = [ "nosuid" "nodev" "noauto" ];
}; };
# Bulk storage mounts
"/persist/var/lib/libvirt" = {
device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355";
options = [ "subvol=libvirt" "nosuid" "nodev" "nofail" ];
};
"/persist/home/jimbo/VMs" = {
device = "/dev/disk/by-uuid/abf78669-de2a-4afa-8e62-604f4e4cb355";
options = [ "subvol=images" "nosuid" "nodev" "nofail" ];
};
# Network mounts # Network mounts
"/home/jimbo/JimboNFS" = { "/home/jimbo/JimboNFS" = {
device = "${config.ips.server}:/export/JimboNFS"; device = "${config.ips.server}:/export/JimboNFS";

View file

@ -1,8 +1,5 @@
{ pkgs, config, ... }: { { pkgs, config, ... }: {
home.file = { home.file = {
"VMs" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";
};
".face" = { ".face" = {
source = ./assets/pfp.png; source = ./assets/pfp.png;
}; };

View file

@ -9,6 +9,7 @@
"Pictures" "Pictures"
"Videos" "Videos"
"Games" "Games"
"VMs"
".snapshots" ".snapshots"
".mozilla" ".mozilla"

View file

@ -5,16 +5,10 @@
directories = [ directories = [
"/etc/nixos" "/etc/nixos"
"/etc/secureboot" "/etc/secureboot"
"/var/log"
"/var/lib/systemd/coredump"
"/var/lib/nixos" "/var/lib/nixos"
]; ];
files = [ files = [
"/etc/machine-id" "/etc/machine-id"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
]; ];
}; };
} }

View file

@ -3,5 +3,6 @@
imports = [ imports = [
./apparmor ./apparmor
./doas ./doas
./polkit
]; ];
} }

View file

@ -0,0 +1,7 @@
{ config, ... }:
{
security = {
polkit.enable = config.system.desktop.enable;
rtkit.enable = config.system.desktop.enable;
};
}

View file

@ -11,4 +11,11 @@
UsePAM = false; UsePAM = false;
}; };
}; };
environment.persistence."/persist".files = [
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
];
} }

View file

@ -5,7 +5,6 @@
./gvfs ./gvfs
./libvirtd ./libvirtd
./mpd ./mpd
./polkit
./sunshine ./sunshine
]; ];
} }

View file

@ -27,7 +27,8 @@
}; };
}; };
environment.systemPackages = with pkgs; [ environment = {
systemPackages = with pkgs; [
virt-manager virt-manager
virtiofsd virtiofsd
dnsmasq dnsmasq
@ -35,6 +36,16 @@
looking-glass-client looking-glass-client
]; ];
persistence."/persist".directories = [
"/var/lib/libvirt/dnsmasq"
"/var/lib/libvirt/nwfilter"
"/var/lib/libvirt/qemu"
"/var/lib/libvirt/secrets"
"/var/lib/libvirt/storage"
"/var/lib/libvirt/swtpm"
];
};
# Needed to make NAT work # Needed to make NAT work
networking.firewall.trustedInterfaces = [ networking.firewall.trustedInterfaces = [
"virbr0" "virbr0"

View file

@ -1,7 +0,0 @@
{ ... }:
{
security = {
polkit.enable = true;
rtkit.enable = true;
};
}