Begin the move to the import all, activate by config model
This commit is contained in:
parent
7397b614de
commit
07cb2d67a2
97 changed files with 776 additions and 633 deletions
|
@ -3,9 +3,9 @@
|
|||
imports = [
|
||||
./gnome-keyring
|
||||
./gvfs
|
||||
./keyd
|
||||
./libvirtd
|
||||
./mpd
|
||||
./polkit
|
||||
./snapper
|
||||
./sunshine
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
services.gnome.gnome-keyring.enable = config.system.desktop.enable;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
services = {
|
||||
gvfs.enable = true;
|
||||
udisks2.enable = true;
|
||||
gvfs.enable = config.system.desktop.enable;
|
||||
udisks2.enable = config.system.desktop.enable;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
46
modules/system/services/pc/libvirtd/default.nix
Normal file
46
modules/system/services/pc/libvirtd/default.nix
Normal 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 -" ];
|
||||
};
|
||||
}
|
|
@ -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" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./root
|
||||
./jimbo
|
||||
];
|
||||
|
||||
services.snapper = {
|
||||
snapshotInterval = "0/6:00:00";
|
||||
cleanupInterval = "12:00:00";
|
||||
persistentTimer = true;
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
};
|
||||
}
|
|
@ -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;
|
||||
};
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
enable = config.system.desktop.enable;
|
||||
autoStart = false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 -"
|
||||
];
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
virtualisation.waydroid.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue