From 7a37b2f5b3c96b0c8ea408b8b5afb9cce3c35e19 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 16 Nov 2021 11:16:49 -0500 Subject: [PATCH] modules/info: add info.graphical --- modules/info.nix | 10 ++++++++++ users/infinidoge/default.nix | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/info.nix b/modules/info.nix index 88d2037..6b2e32a 100644 --- a/modules/info.nix +++ b/modules/info.nix @@ -6,5 +6,15 @@ with lib; type = types.int; default = 1; }; + + graphical = mkOption { + type = with types; bool; + default = false; + description = "Whether or not we are in a graphical environment"; + }; + }; + + config = { + info.graphical = config.services.xserver.enable; }; } diff --git a/users/infinidoge/default.nix b/users/infinidoge/default.nix index b9c7df4..a078ce5 100644 --- a/users/infinidoge/default.nix +++ b/users/infinidoge/default.nix @@ -1,7 +1,7 @@ { config, self, lib, pkgs, suites, profiles, inputs, ... }: let - ifGraphical = lib.optionals config.services.xserver.enable; - ifGraphical' = lib.optional config.services.xserver.enable; + ifGraphical = lib.optionals config.info.graphical; + ifGraphical' = lib.optional config.info.graphical; in { imports = lib.flatten [