system: add mutually exclusive session option
This option makes desktop-specific specialisations easier to configure
This commit is contained in:
parent
70e7558421
commit
3cf6b93eb5
@ -42,8 +42,7 @@
|
|||||||
specialisation.plasma.configuration = {
|
specialisation.plasma.configuration = {
|
||||||
system.nixos.tags = [ "Plasma" ];
|
system.nixos.tags = [ "Plasma" ];
|
||||||
nixfiles = {
|
nixfiles = {
|
||||||
sessions.hyprland.enable = false;
|
session = "plasma";
|
||||||
sessions.plasma.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,8 +64,7 @@
|
|||||||
};
|
};
|
||||||
programs.unbound.enable = true;
|
programs.unbound.enable = true;
|
||||||
common.remoteAccess.enable = true;
|
common.remoteAccess.enable = true;
|
||||||
sessions.plasma.enable = lib.mkDefault true;
|
session = lib.mkDefault "hyprland";
|
||||||
sessions.hyprland.enable = lib.mkDefault false;
|
|
||||||
hardware.nvidia.modesetting.enable = true;
|
hardware.nvidia.modesetting.enable = true;
|
||||||
packageSets.gaming.enable = true;
|
packageSets.gaming.enable = true;
|
||||||
};
|
};
|
||||||
|
@ -36,8 +36,7 @@
|
|||||||
specialisation.plasma.configuration = {
|
specialisation.plasma.configuration = {
|
||||||
system.nixos.tags = [ "Plasma" ];
|
system.nixos.tags = [ "Plasma" ];
|
||||||
nixfiles = {
|
nixfiles = {
|
||||||
sessions.hyprland.enable = false;
|
session = "plasma";
|
||||||
sessions.plasma.enable = true;
|
|
||||||
};
|
};
|
||||||
services.displayManager.sddm.enable = lib.mkForce true;
|
services.displayManager.sddm.enable = lib.mkForce true;
|
||||||
services.xserver.displayManager.startx.enable = lib.mkForce false;
|
services.xserver.displayManager.startx.enable = lib.mkForce false;
|
||||||
@ -56,8 +55,7 @@
|
|||||||
gaming.enable = true;
|
gaming.enable = true;
|
||||||
fun.enable = true;
|
fun.enable = true;
|
||||||
};
|
};
|
||||||
sessions.hyprland.enable = lib.mkDefault true;
|
session = lib.mkDefault "hyprland";
|
||||||
sessions.plasma.enable = lib.mkDefault false;
|
|
||||||
programs = {
|
programs = {
|
||||||
adb.enable = true;
|
adb.enable = true;
|
||||||
unbound.enable = false;
|
unbound.enable = false;
|
||||||
|
@ -1,5 +1,26 @@
|
|||||||
{...}:
|
{ config, lib, options, ... }:
|
||||||
{ imports = [
|
let
|
||||||
|
inherit (lib) types;
|
||||||
|
cfg = config.nixfiles.session;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
./hyprland.nix
|
./hyprland.nix
|
||||||
./plasma.nix
|
./plasma.nix
|
||||||
];}
|
];
|
||||||
|
|
||||||
|
options.nixfiles.session = lib.mkOption {
|
||||||
|
description = ''
|
||||||
|
Desktop session to enable. This option serves as a convenient way to
|
||||||
|
enable sessions in a mutually exclusive manner, e.g., for use with
|
||||||
|
specialisations.
|
||||||
|
'';
|
||||||
|
type = with types; nullOr (enum (builtins.attrNames options.nixfiles.sessions));
|
||||||
|
default = null;
|
||||||
|
example = "hyprland";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (!(builtins.isNull cfg)) {
|
||||||
|
nixfiles.sessions.${cfg}.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user