Move quirks to profiles

This commit is contained in:
Christopher Mühl 2026-01-06 03:13:41 +01:00
parent 3026b6dbec
commit 0d17a0baf1
No known key found for this signature in database
GPG key ID: 925AC7D69955293F
8 changed files with 11 additions and 22 deletions

View file

@ -15,6 +15,8 @@
bosun = { bosun = {
profiles = { profiles = {
graphical.enable = true; graphical.enable = true;
docker.enable = true;
work.enable = true;
}; };
#quirks = ["avahi" "docker" "nix-ld"]; #quirks = ["avahi" "docker" "nix-ld"];

View file

@ -4,7 +4,7 @@ in {
options.bosun.profiles = { options.bosun.profiles = {
graphical.enable = mkEnableOption "Graphical interface"; graphical.enable = mkEnableOption "Graphical interface";
headless.enable = mkEnableOption "Headless"; headless.enable = mkEnableOption "Headless";
workstation.enable = mkEnableOption "Workstation"; docker.enable = mkEnableOption "Docker usage";
server.enable = mkEnableOption "Server"; work.enable = mkEnableOption "Work setup";
}; };
} }

View file

@ -4,5 +4,6 @@
./profiles ./profiles
./system.nix ./system.nix
./users.nix ./users.nix
./nix-ld.nix
]; ];
} }

View file

@ -4,7 +4,8 @@
lib, lib,
... ...
}: { }: {
config = lib.mkIf (builtins.elem "nix-ld" config.elements.quirks) { # TODO: Enable quirk somehow
config = lib.mkIf false {
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [ programs.nix-ld.libraries = with pkgs; [
SDL SDL

View file

@ -1,5 +1,7 @@
{ {
imports = [ imports = [
./graphical ./graphical
./work
./docker
]; ];
} }

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: { }: {
config = lib.mkIf (builtins.elem "docker" config.elements.quirks) { config = lib.mkIf config.bosun.profiles.docker.enable {
virtualisation.docker = { virtualisation.docker = {
enable = true; enable = true;

View file

@ -2,10 +2,9 @@
config, config,
lib, lib,
pkgs, pkgs,
modulesPath,
... ...
}: { }: {
config = lib.mkIf (builtins.elem "avahi" config.elements.quirks) { config = lib.mkIf config.bosun.profiles.work.enable {
services = { services = {
# Name Server Caching Daemon # Name Server Caching Daemon
nscd = { nscd = {

View file

@ -1,16 +0,0 @@
{lib, ...}: {
# All quirks are imported and check themselves whether they are enabled
# via `(builtins.elem "quirk" config.elements.quirks)`.
imports = [
./avahi.nix
./docker.nix
./nix-ld.nix
];
options.elements = with lib; {
quirks = mkOption {
type = types.listOf types.str;
default = [];
};
};
}