From b82ecc4a0552b65a2c61204446851ebc088d4c49 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Thu, 13 Nov 2025 06:33:33 +0100 Subject: [PATCH] developer: add a developer profile example Signed-off-by: Ryan Lahfa --- common/default.nix | 3 +++ developer/default.nix | 7 ++++++- developer/virtualisation.nix | 33 ++++++++++++++++++++------------- inventory/machines/PC140V35.nix | 2 ++ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/common/default.nix b/common/default.nix index 6a6991b..026f8d2 100644 --- a/common/default.nix +++ b/common/default.nix @@ -37,6 +37,9 @@ # Laptop: power optimizations, etc. ./laptop.nix + + # Allow the developer profile which is disabled by default. + ../developer ]; securix.self.machine = { diff --git a/developer/default.nix b/developer/default.nix index c142a23..ec42ef8 100644 --- a/developer/default.nix +++ b/developer/default.nix @@ -1,8 +1,13 @@ # SPDX-FileCopyrightText: 2025 Ryan Lahfa # # SPDX-License-Identifier: MIT - +{ lib, ... }: +let + inherit (lib) mkEnableOption; +in { + options.bureautix.developer.enable = mkEnableOption "the developer profile"; + imports = [ # This allows a developer to spawn his own virtual machines and do his own things. ./virtualisation.nix diff --git a/developer/virtualisation.nix b/developer/virtualisation.nix index bd698c3..9fff271 100644 --- a/developer/virtualisation.nix +++ b/developer/virtualisation.nix @@ -1,20 +1,27 @@ # SPDX-FileCopyrightText: 2025 Ryan Lahfa # # SPDX-License-Identifier: MIT - +{ lib, config, ... }: +let + inherit (lib) mkIf; +in { - programs.virt-manager.enable = true; - virtualisation = { - libvirtd.enable = true; + config = mkIf config.bureautix.developer.enable { + programs.virt-manager.enable = true; + # NOTE: this does not handle the multi-user. + users.users.${config.securix.self.user.username}.extraGroups = [ "libvirtd" ]; + virtualisation = { + libvirtd.enable = true; - # You can choose to allow Docker or Podman or you can tell the developers to install their own distribution - # inside the system and do their thing there! - # docker.enable = true; - # podman.enable = true; - }; + # You can choose to allow Docker or Podman or you can tell the developers to install their own distribution + # inside the system and do their thing there! + # docker.enable = true; + # podman.enable = true; + }; - environment.systemPackages = [ - # distrobox: a wrapper for podman and docker to start your own preferred distribution. - # Useful for developers who are unhappy about NixOS! - ]; + environment.systemPackages = [ + # distrobox: a wrapper for podman and docker to start your own preferred distribution. + # Useful for developers who are unhappy about NixOS! + ]; + }; } diff --git a/inventory/machines/PC140V35.nix b/inventory/machines/PC140V35.nix index b0bde34..0d26633 100644 --- a/inventory/machines/PC140V35.nix +++ b/inventory/machines/PC140V35.nix @@ -12,4 +12,6 @@ "heloise" ]; }; + + bureautix.developer.enable = true; }