Add conditionals and assertions

This commit is contained in:
Vili Sinervä 2024-06-06 22:16:29 +03:00
parent 3754cbb0c0
commit 6b04b535c1
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
7 changed files with 30 additions and 3 deletions

View file

@ -8,7 +8,7 @@
boot.initrd.kernelModules = [ "amdgpu" ];
services = {
xserver = {
xserver = pkgs.lib.mkIf config.services.xserver.enable {
videoDrivers = [
"amdgpu"
"modesetting"

View file

@ -1,7 +1,7 @@
# Config for Keychron Q11 keyboard
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [ via ];
environment.systemPackages = with pkgs; if config.services.xserver.enable then [ via ] else [ ];
# Keychron Q11
services.udev.extraRules = ''

View file

@ -1,6 +1,13 @@
# Config for my Logitech trackball
{ config, pkgs, ... }:
{
assertions = [
{
assertion = config.services.xserver.enable;
message = "Trackball does not work without a desktop!";
}
];
disabledModules = [ "services/hardware/libinput.nix" ];
nixpkgs.overlays = [