diff --git a/dev/default.nix b/dev/default.nix index 8949320..f8d9057 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -1,10 +1,14 @@ +{ pkgs, lib, config, ... }: +let + settings = import ./../settings.nix; +in { imports = [ ./language-server.nix - ./dotnet.nix - ./docker-rootless.nix - ./platformio.nix - ./qemu.nix - ./latex.nix - ]; + ] + ++ lib.optionals settings.virtualisation.docker-rootless.enable [ ./docker-rootless.nix ] + ++ lib.optionals settings.virtualisation.qemu.enable [ ./qemu.nix ] + ++ lib.optionals settings.dev.platformio [ ./platformio.nix ] + ++ lib.optionals settings.dev.latex [ ./latex.nix ] + ++ lib.optionals settings.dev.dotnet [ ./dotnet.nix ]; } diff --git a/dev/docker-rootless.nix b/dev/docker-rootless.nix index 7b60e25..3dc3640 100644 --- a/dev/docker-rootless.nix +++ b/dev/docker-rootless.nix @@ -1,9 +1,13 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +let + settings = import ./../settings.nix; +in +{ # enable rootless docker for more security virtualisation.docker.rootless = { enable = true; setSocketVariable = true; }; # regulary clean unused docker images - virtualisation.docker.autoPrune.enable = true; + virtualisation.docker.autoPrune.enable = settings.virtualisation.docker-rootless.autoPrune; } diff --git a/dev/qemu.nix b/dev/qemu.nix index 1c5c1f3..48abae9 100644 --- a/dev/qemu.nix +++ b/dev/qemu.nix @@ -1,10 +1,14 @@ -{ pkgs, config, ... }: { +{ pkgs, config, ... }: +let + settings = import ./../settings.nix; +in +{ # KVM virtualisation.libvirtd.enable = true; - # programs.virt-manager.enable = true; # after 23.11 + programs.virt-manager.enable = settings.virtualisation.qemu.virt-manager; # after 23.11 # only before 23.11 - environment.systemPackages = (with pkgs; [ - virt-manager - ]); + # environment.systemPackages = (with pkgs; [ + # virt-manager + # ]); } diff --git a/settings.nix b/settings.nix index f92fb2b..0c22b12 100644 --- a/settings.nix +++ b/settings.nix @@ -14,6 +14,22 @@ with import {}; { }; }; + virtualisation = { + docker-rootless = { + enable = true; + autoPrune = true; + }; + qemu = { + enable = true; + virt-manager = true; + }; + }; + dev = { + platformio = true; + latex = true; + dotnet = false; + }; + dvd = true; # enable DVD decryption + ripping via Handbrake bluray = true; # enable Bluray decryption (requires additional setup) printing = {