From 40d286ac3a9cadef02cd7afc05b27de2f19039ee Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 18 Dec 2023 00:11:11 +0800 Subject: [PATCH] profiles/dev: separate containers and virtual machines setup --- hosts/ni/modules/setups/development.nix | 3 ++- hosts/winnowing/default.nix | 2 +- modules/nixos/profiles/dev.nix | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/hosts/ni/modules/setups/development.nix b/hosts/ni/modules/setups/development.nix index e5445f80..e9f56fc0 100644 --- a/hosts/ni/modules/setups/development.nix +++ b/hosts/ni/modules/setups/development.nix @@ -14,7 +14,8 @@ in profiles.dev = { enable = true; extras.enable = true; - virtualization.enable = true; + containers.enable = true; + virtual-machines.enable = true; neovim.enable = true; }; diff --git a/hosts/winnowing/default.nix b/hosts/winnowing/default.nix index 1bf6379d..c52daea7 100644 --- a/hosts/winnowing/default.nix +++ b/hosts/winnowing/default.nix @@ -33,5 +33,5 @@ # Setting the development environment mainly for container-related work. profiles.dev.enable = true; - profiles.dev.virtualization.enable = true; + profiles.dev.containers.enable = true; } diff --git a/modules/nixos/profiles/dev.nix b/modules/nixos/profiles/dev.nix index 4aeebff2..9a1fa2db 100644 --- a/modules/nixos/profiles/dev.nix +++ b/modules/nixos/profiles/dev.nix @@ -7,6 +7,7 @@ in { enable = lib.mkEnableOption "basic configuration for software development"; extras.enable = lib.mkEnableOption "additional shell utilities"; containers.enable = lib.mkEnableOption "containers setup"; + virtual-machines.enable = lib.mkEnableOption "virtual machines setup"; neovim.enable = lib.mkEnableOption "Neovim setup"; }; @@ -122,7 +123,7 @@ in { }) # !!! Please add your user to the "libvirtd" group. - (lib.mkIf cfg.virtualization.enable { + (lib.mkIf cfg.containers.enable { environment.systemPackages = with pkgs; [ dive # Dive into container images. ]; @@ -163,6 +164,12 @@ in { "registry.opensuse.org" ]; }; + }) + + (lib.mkIf cfg.virtual-machines.enable { + environment.systemPackages = with pkgs; [ + virt-manager # An interface for those who are lazy to read a reference manual and create a 1000-line configuration per machine. + ]; # Virtual machines, son. They open in response to physical needs to # foreign environments.