blob: 88f8fa20a248fd721bcacdf9d594755cf8d75365 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{
config,
lib,
pkgs,
...
} @ extraArgs: let
cfg = config.personal.gui;
wallpaper = pkgs.personal.static.wallpapers.nga-1973-68-1.override {gravity = "north";};
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 [
{
services.xserver = lib.mkIf cfg.xserver.enable {
enable = true;
desktopManager.xfce.enable = true;
displayManager = {
lightdm = {
enable = true;
background = lib.mkDefault (config.stylix.image or wallpaper);
greeters.gtk = {
enable = true;
extraConfig = ''
user-background = false
'';
theme = lib.mkDefault {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = lib.mkDefault {
name = "Breeze-dark";
package = pkgs.breeze-icons;
};
};
};
};
# Hardware
libinput.enable = true;
layout = config.personal.hardware.keyboard.keyMap;
autoRepeatDelay = 200;
};
}
(lib.mkIf cfg.i3.enable {
services.xserver = {
desktopManager.xfce = {
noDesktop = true;
enableXfwm = false;
};
windowManager.i3.enable = true;
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";
fonts.sizes = {
applications = 10;
desktop = 12;
};
};
}))
]);
}
|