From f25a86f7c00326d0454a7d531754499cc77a2b89 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 18 Oct 2023 16:47:13 +0200 Subject: [PATCH] [virtualbox] Move into proper module --- nixos/hosts/Tibo-NixFat/default.nix | 1 - nixos/modules-old/apps/default.nix | 1 - nixos/modules-old/apps/virtualbox/default.nix | 17 -------------- nixos/modules/default.nix | 1 + nixos/modules/users/tdpeuter/default.nix | 1 - nixos/modules/virtualisation/default.nix | 5 ++++ .../virtualisation/virtualbox/default.nix | 23 +++++++++++++++++++ 7 files changed, 29 insertions(+), 20 deletions(-) delete mode 100644 nixos/modules-old/apps/virtualbox/default.nix create mode 100644 nixos/modules/virtualisation/default.nix create mode 100644 nixos/modules/virtualisation/virtualbox/default.nix diff --git a/nixos/hosts/Tibo-NixFat/default.nix b/nixos/hosts/Tibo-NixFat/default.nix index 9337f45..667b8ff 100644 --- a/nixos/hosts/Tibo-NixFat/default.nix +++ b/nixos/hosts/Tibo-NixFat/default.nix @@ -5,7 +5,6 @@ ./hardware-configuration.nix ../../modules-old/hardware/nvidia.nix - ../../modules-old/apps/virtualbox ../../modules-old/des/gnome ]; diff --git a/nixos/modules-old/apps/default.nix b/nixos/modules-old/apps/default.nix index 4ad4b18..cd1aa58 100644 --- a/nixos/modules-old/apps/default.nix +++ b/nixos/modules-old/apps/default.nix @@ -4,6 +4,5 @@ ./kitty ./steam ./thunderbird - # ./virtualbox ]; } diff --git a/nixos/modules-old/apps/virtualbox/default.nix b/nixos/modules-old/apps/virtualbox/default.nix deleted file mode 100644 index 8766028..0000000 --- a/nixos/modules-old/apps/virtualbox/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - - virtualisation.virtualbox = { - host = { - enable = true; - enableExtensionPack = true; - }; - guest = { - enable = true; - x11 = true; - }; - }; - users.extraGroups.vboxusers.members = [ - "user-with-access-to-virtualbox" - ]; - -} diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index d89efe6..18a9fb3 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -4,5 +4,6 @@ imports = [ ./programs ./users + ./virtualisation ]; } diff --git a/nixos/modules/users/tdpeuter/default.nix b/nixos/modules/users/tdpeuter/default.nix index 503f9ba..2a94de0 100644 --- a/nixos/modules/users/tdpeuter/default.nix +++ b/nixos/modules/users/tdpeuter/default.nix @@ -30,7 +30,6 @@ in { # If you specify an application here, it will be detected by the configuration module # and the configuration files will be put in place for you. packages = with pkgs; [ - brave duf jellyfin-media-player libreoffice-fresh diff --git a/nixos/modules/virtualisation/default.nix b/nixos/modules/virtualisation/default.nix new file mode 100644 index 0000000..01f37b3 --- /dev/null +++ b/nixos/modules/virtualisation/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./virtualbox + ]; +} diff --git a/nixos/modules/virtualisation/virtualbox/default.nix b/nixos/modules/virtualisation/virtualbox/default.nix new file mode 100644 index 0000000..f4a31b6 --- /dev/null +++ b/nixos/modules/virtualisation/virtualbox/default.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.sisyphus.virtualisation.virtualbox; +in { + options.sisyphus.virtualisation.virtualbox.enable = lib.mkEnableOption "VirtualBox"; + + config = lib.mkIf cfg.enable { + virtualisation.virtualbox = { + host = { + enable = true; + enableExtensionPack = true; + }; + guest = { + enable = true; + x11 = true; + }; + }; + users.extraGroups.vboxusers.members = [ + "user-with-access-to-virtualbox" + ]; + }; +}