refactor: modules/gui/default.nix: fold into hosts/modules/gui/default.nix

This commit is contained in:
Colin 2023-01-30 01:49:51 +00:00
parent a9cf619a14
commit cb3e7623ae
3 changed files with 26 additions and 25 deletions

View File

@ -1,4 +1,9 @@
{ ... }:
{ lib, config, ... }:
let
inherit (lib) mkDefault mkIf mkOption types;
cfg = config.sane.gui;
in
{
imports = [
./gnome.nix
@ -7,4 +12,24 @@
./plasma-mobile.nix
./sway.nix
];
options = {
sane.gui.enable = mkOption {
default = false;
type = types.bool;
description = ''
enables config used by any GUI, like display management or select packages.
the user should prefer to interact with specific GUIs like `sane.gui.sway`
and let those modules auto-set this flag when necessary.
'';
};
};
config = mkIf cfg.enable {
sane.packages.enableGuiPkgs = mkDefault true;
# preserve backlight brightness across power cycles
# see `man systemd-backlight`
sane.persist.sys.plaintext = [ "/var/lib/systemd/backlight" ];
};
}

View File

@ -4,7 +4,6 @@
imports = [
./feeds.nix
./fs
./gui
./home-manager
./ids.nix
./packages.nix

View File

@ -1,23 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.sane.gui;
in
{
options = {
# doesn't directly create outputs. consumed by e.g. home-manager.nix module
sane.gui.enable = mkOption {
default = false;
type = types.bool;
};
};
config = lib.mkIf cfg.enable {
sane.packages.enableGuiPkgs = lib.mkDefault true;
# preserve backlight brightness across power cycles
# see `man systemd-backlight`
sane.persist.sys.plaintext = [ "/var/lib/systemd/backlight" ];
};
}