diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2023-03-01 16:04:54 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2023-03-01 16:04:54 +0100 |
| commit | 119f588fb9c9d78ac3c49f19bdbc00f67d2cf6b2 (patch) | |
| tree | 63e9c9250541e4187b9ffea74249dfa4ff9a23ba /modules/nixos | |
| parent | 857b17aa02062cc3e036e4049e37c11eb1a7e707 (diff) | |
nixos: gui: add stylix
Diffstat (limited to 'modules/nixos')
| -rw-r--r-- | modules/nixos/personal/gui.nix | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/modules/nixos/personal/gui.nix b/modules/nixos/personal/gui.nix index d4de375..2838863 100644 --- a/modules/nixos/personal/gui.nix +++ b/modules/nixos/personal/gui.nix @@ -1,11 +1,18 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }@extraArgs: -let cfg = config.personal.gui; +let + cfg = config.personal.gui; + wallpaper = pkgs.personal.static.wallpapers.nga-1973-68-1; + importedStylix = extraArgs ? stylix; in { + imports = + lib.optional importedStylix extraArgs.stylix.nixosModules.stylix; + options.personal.gui = { enable = lib.mkEnableOption "GUI"; xserver.enable = lib.mkEnableOption "X server"; i3.enable = lib.mkEnableOption "i3"; + stylix.enable = lib.mkEnableOption "stylix"; }; config = lib.mkIf cfg.enable (lib.mkMerge [ @@ -16,17 +23,17 @@ in { displayManager = { lightdm = { enable = true; - # background = background-image; + background = lib.mkDefault wallpaper; greeters.gtk = { enable = true; - # extraConfig = '' - # user-background = false - # ''; - theme = { + extraConfig = '' + user-background = false + ''; + theme = lib.mkDefault { name = "Arc-Dark"; package = pkgs.arc-theme; }; - iconTheme = { + iconTheme = lib.mkDefault { name = "Breeze-dark"; package = pkgs.breeze-icons; }; @@ -50,5 +57,19 @@ in { displayManager.defaultSession = "xfce+i3"; }; }) + (lib.mkIf cfg.stylix.enable ({ + assertions = let + missingArgAssertion = name: { + assertion = lib.hasAttr name extraArgs; + message = + "attribute ${name} missing: add it in lib.nixosSystem's specialArgs, or set config.personal.gui.stylix.enable to false"; + }; + in [ (missingArgAssertion "stylix") ]; + } // lib.optionalAttrs importedStylix { + stylix = { + image = lib.mkDefault wallpaper; + polarity = lib.mkDefault "dark"; + }; + })) ]); } |
