From 1ce57ea3807d4e99d35f14d5aa37951bb6e548a1 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Tue, 10 Dec 2024 18:30:13 +0100 Subject: [PATCH] feat: make virtualbox into specialisation because i almost never need it --- SwarselSystems.org | 30 ++++++++++++++++---------- profiles/nbl-imba-2/default.nix | 2 +- profiles/optional/nixos/virtualbox.nix | 26 ++++++++++++++-------- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 1ae96c1..ce02a6b 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -921,7 +921,7 @@ My work machine. Built for more security, this is the gold standard of my config "${profilesPath}/optional/nixos/steam.nix" "${profilesPath}/optional/nixos/virtualbox.nix" - # ../optional/nixos/vmware.nix + # "${profilesPath}/optional/nixos/vmware.nix" "${profilesPath}/optional/nixos/autologin.nix" "${profilesPath}/optional/nixos/nswitch-rcm.nix" "${profilesPath}/optional/nixos/work.nix" @@ -5908,21 +5908,29 @@ This opens a few gaming ports and installs the steam configuration suite for gam :CUSTOM_ID: h:b3523246-14e9-4284-ba22-cebc5ca36732 :END: -This sets the VirtualBox configuration. Guest should not be enabled if not direly needed, it will make rebuilds unbearably slow. +This sets the VirtualBox configuration. Guest should not be enabled if not direly needed, it will make rebuilds unbearably slow. I only use this privately to run an old editor that does not run well under wine, so I put it into it's own specialisation. #+begin_src nix :tangle profiles/optional/nixos/virtualbox.nix - _: + { lib, pkgs, ... }: { - virtualisation.virtualbox = { - host = { - enable = true; - enableExtensionPack = true; - }; - # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch - guest = { - enable = false; + + specialisation = { + VBox.configuration = { + virtualisation.virtualbox = { + host = { + enable = true; + enableExtensionPack = true; + }; + # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch + guest = { + enable = false; + }; + }; + # run an older kernel to provide compatibility with windows vm + boot.kernelPackages = lib.mkForce pkgs.linuxPackages; }; }; + } #+end_src diff --git a/profiles/nbl-imba-2/default.nix b/profiles/nbl-imba-2/default.nix index 49cc4af..1cc61da 100644 --- a/profiles/nbl-imba-2/default.nix +++ b/profiles/nbl-imba-2/default.nix @@ -13,7 +13,7 @@ in "${profilesPath}/optional/nixos/steam.nix" "${profilesPath}/optional/nixos/virtualbox.nix" - # ../optional/nixos/vmware.nix + # "${profilesPath}/optional/nixos/vmware.nix" "${profilesPath}/optional/nixos/autologin.nix" "${profilesPath}/optional/nixos/nswitch-rcm.nix" "${profilesPath}/optional/nixos/work.nix" diff --git a/profiles/optional/nixos/virtualbox.nix b/profiles/optional/nixos/virtualbox.nix index d5406a9..3eaa64a 100644 --- a/profiles/optional/nixos/virtualbox.nix +++ b/profiles/optional/nixos/virtualbox.nix @@ -1,13 +1,21 @@ -_: +{ lib, pkgs, ... }: { - virtualisation.virtualbox = { - host = { - enable = true; - enableExtensionPack = true; - }; - # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch - guest = { - enable = false; + + specialisation = { + VBox.configuration = { + virtualisation.virtualbox = { + host = { + enable = true; + enableExtensionPack = true; + }; + # leaving this here for future notice. setting guest.enable = true will make 'restarting sysinit-reactivation.target' take till timeout on nixos-rebuild switch + guest = { + enable = false; + }; + }; + # run an older kernel to provide compatibility with windows vm + boot.kernelPackages = lib.mkForce pkgs.linuxPackages; }; }; + }