Begin the move to the import all, activate by config model

This commit is contained in:
Jimbo 2024-11-04 22:41:38 -05:00
parent 7397b614de
commit 07cb2d67a2
97 changed files with 776 additions and 633 deletions

View file

@ -3,9 +3,9 @@
imports = [
./gnome-keyring
./gvfs
./keyd
./libvirtd
./mpd
./polkit
./snapper
./sunshine
];
}

View file

@ -1,4 +1,4 @@
{ ... }:
{ config, ... }:
{
services.gnome.gnome-keyring.enable = true;
services.gnome.gnome-keyring.enable = config.system.desktop.enable;
}

View file

@ -1,7 +1,7 @@
{ ... }:
{ config, ... }:
{
services = {
gvfs.enable = true;
udisks2.enable = true;
gvfs.enable = config.system.desktop.enable;
udisks2.enable = config.system.desktop.enable;
};
}

View file

@ -1,46 +0,0 @@
{ ... }:
{
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = {
capslock = "overload(control,esc)";
leftcontrol = "overload(ctrlmod,noop)";
esc = "`";
rightcontrol = "esc";
left = "noop";
down = "noop";
up = "noop";
right = "noop";
};
control = {
h = "left";
j = "down";
k = "up";
l = "right";
g = "macro(C-h)";
semicolon = "macro(C-l)";
};
ctrlmod = {
backspace = "delete";
"1" = "f1";
"2" = "f2";
"3" = "f3";
"4" = "f4";
"5" = "f5";
"6" = "f6";
"7" = "f7";
"8" = "f8";
"9" = "f9";
"0" = "f10";
"-" = "f11";
"=" = "f12";
};
};
};
};
}

View file

@ -0,0 +1,46 @@
{ config, lib, pkgs, ... }:
{
options.system.libvirtd = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable libvirtd and such";
};
};
config = lib.mkIf config.system.libvirtd.enable {
virtualisation = {
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = {
ovmf = {
enable = true;
packages = [
pkgs.OVMFFull.fd
pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd
];
};
swtpm.enable = true;
};
};
};
environment.systemPackages = with pkgs; [
virt-manager
virtiofsd
dnsmasq
spice-vdagent
looking-glass-client
];
# Needed to make NAT work
networking.firewall.trustedInterfaces = [
"virbr0"
"virbr1"
];
systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 jimbo libvirtd -" ];
};
}

View file

@ -1,22 +1,24 @@
{ config, ... }:
{ config, lib, ... }:
{
services.mpd = {
enable = true;
user = "jimbo";
group = "users";
musicDirectory = "/home/jimbo/JimboNFS/Music/Synced";
playlistDirectory = "/home/jimbo/JimboNFS/Music/Synced/Playlists";
extraConfig = ''
audio_output {
type "pipewire"
name "Local Pipewire"
}
'';
};
config = lib.mkIf config.system.desktop.enable {
services.mpd = {
enable = true;
user = "jimbo";
group = "users";
musicDirectory = "/home/jimbo/JimboNFS/Music/Synced";
playlistDirectory = "/home/jimbo/JimboNFS/Music/Synced/Playlists";
extraConfig = ''
audio_output {
type "pipewire"
name "Local Pipewire"
}
'';
};
systemd.services.mpd.environment = {
XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jimbo.uid}";
};
systemd.services.mpd.environment = {
XDG_RUNTIME_DIR = "/run/user/${toString config.users.users.jimbo.uid}";
};
environment.persistence."/persist".directories = [ "/var/lib/mpd" ];
environment.persistence."/persist".directories = [ "/var/lib/mpd" ];
};
}

View file

@ -1,13 +0,0 @@
{ ... }:
{
imports = [
./root
./jimbo
];
services.snapper = {
snapshotInterval = "0/6:00:00";
cleanupInterval = "12:00:00";
persistentTimer = true;
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
services.snapper.configs.jimbo = {
SUBVOLUME = "/persist/home/jimbo";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1;
TIMELINE_LIMIT_WEEKLY = 1;
TIMELINE_LIMIT_MONTHLY = 0;
TIMELINE_LIMIT_YEARLY = 0;
};
}

View file

@ -1,12 +0,0 @@
{ ... }:
{
services.snapper.configs.root = {
SUBVOLUME = "/persist";
TIMELINE_CREATE = true;
TIMELINE_CLEANUP = true;
TIMELINE_LIMIT_DAILY = 1;
TIMELINE_LIMIT_WEEKLY = 0;
TIMELINE_LIMIT_MONTHLY = 0;
TIMELINE_LIMIT_YEARLY = 0;
};
}

View file

@ -1,7 +1,7 @@
{ ... }:
{ config, ... }:
{
services.sunshine = {
enable = true;
enable = config.system.desktop.enable;
autoStart = false;
};
}

View file

@ -1,40 +0,0 @@
{ config, pkgs, ... }:
{
virtualisation = {
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemu = {
ovmf = {
enable = true;
packages = [
pkgs.OVMFFull.fd
pkgs.pkgsCross.aarch64-multiplatform.OVMF.fd
];
};
swtpm.enable = true;
};
};
spiceUSBRedirection.enable = true;
};
environment.systemPackages = with pkgs; [
virt-manager
virtiofsd
dnsmasq
spice-vdagent
looking-glass-client
];
# Needed to make NAT work
networking.firewall.trustedInterfaces = [
"virbr0"
"virbr1"
];
# Allow Looking-Glass permissions
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 jimbo libvirtd -"
];
}

View file

@ -1,4 +0,0 @@
{ config, lib, ... }:
{
virtualisation.waydroid.enable = true;
}