feat: use cfg.headless parameter to conditionally enable stylix, DM,
DE/WM
This commit is contained in:
parent
382d78b3d0
commit
e6f4bb1341
1 changed files with 50 additions and 43 deletions
|
|
@ -82,7 +82,7 @@ lib.foldl' (acc: obj: lib.recursiveUpdate acc obj) { } (
|
||||||
|
|
||||||
inputs.stylix.homeModules.stylix
|
inputs.stylix.homeModules.stylix
|
||||||
];
|
];
|
||||||
stylix = {
|
stylix = lib.mkIf (!cfg.headless) {
|
||||||
enable = true;
|
enable = true;
|
||||||
image =
|
image =
|
||||||
if builtins.pathExists ./${user}/wallpaper.png then
|
if builtins.pathExists ./${user}/wallpaper.png then
|
||||||
|
|
@ -95,51 +95,58 @@ lib.foldl' (acc: obj: lib.recursiveUpdate acc obj) { } (
|
||||||
}) cfg.usersList)
|
}) cfg.usersList)
|
||||||
|
|
||||||
# Configure DM and users' default sessions
|
# Configure DM and users' default sessions
|
||||||
{
|
(lib.optionalAttrs (!cfg.headless) {
|
||||||
services.displayManager.gdm.enable = true;
|
services.displayManager.gdm.enable = true;
|
||||||
}
|
})
|
||||||
(map (user: {
|
|
||||||
systemd.tmpfiles.settings."20-gdm-default-session" = {
|
|
||||||
"/run/tmpfiles/var/lib/AccountsService/users/${user}".f = {
|
|
||||||
argument = "${lib.generators.toINI { } {
|
|
||||||
User = {
|
|
||||||
Session = toString (
|
|
||||||
builtins.tail (
|
|
||||||
lib.splitString ":" (builtins.fromJSON (builtins.readFile ./${user}/about.json)).session
|
|
||||||
)
|
|
||||||
);
|
|
||||||
SystemAccount = false;
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
let
|
|
||||||
pic = ./${user}/face.png;
|
|
||||||
in
|
|
||||||
if builtins.pathExists pic then { Icon = "${pic}"; } else { }
|
|
||||||
);
|
|
||||||
}}";
|
|
||||||
};
|
|
||||||
"/var/lib/AccountsService/users/${user}"."L+" = {
|
|
||||||
argument = "/run/tmpfiles/var/lib/AccountsService/users/${user}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}) cfg.usersList)
|
|
||||||
(map (
|
(map (
|
||||||
user:
|
user:
|
||||||
let
|
lib.optionalAttrs (!cfg.headless) {
|
||||||
__session = lib.splitString ":" (builtins.fromJSON (builtins.readFile ./${user}/about.json))
|
systemd.tmpfiles.settings."20-gdm-default-session" = {
|
||||||
.session;
|
"/run/tmpfiles/var/lib/AccountsService/users/${user}".f = {
|
||||||
sessionType = (builtins.head __session);
|
argument = "${lib.generators.toINI { } {
|
||||||
session = toString (builtins.tail __session);
|
User = {
|
||||||
in
|
Session = toString (
|
||||||
assert sessionType == "co" || sessionType == "de";
|
builtins.tail (
|
||||||
if sessionType == "co" then
|
lib.splitString ":" (builtins.fromJSON (builtins.readFile ./${user}/about.json)).session
|
||||||
{
|
)
|
||||||
programs.${session}.enable = true;
|
);
|
||||||
}
|
SystemAccount = false;
|
||||||
else if sessionType == "de" then
|
}
|
||||||
{ services.desktopManager.${session}.enable = true; }
|
// (
|
||||||
else
|
let
|
||||||
{ }
|
pic = ./${user}/face.png;
|
||||||
|
in
|
||||||
|
if builtins.pathExists pic then { Icon = "${pic}"; } else { }
|
||||||
|
);
|
||||||
|
}}";
|
||||||
|
};
|
||||||
|
"/var/lib/AccountsService/users/${user}"."L+" = {
|
||||||
|
argument = "/run/tmpfiles/var/lib/AccountsService/users/${user}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) cfg.usersList)
|
||||||
|
|
||||||
|
(map (
|
||||||
|
user:
|
||||||
|
lib.optionalAttrs (!cfg.headless) (
|
||||||
|
let
|
||||||
|
__session = lib.splitString ":" (builtins.fromJSON (builtins.readFile ./${user}/about.json))
|
||||||
|
.session;
|
||||||
|
sessionType = (builtins.head __session);
|
||||||
|
session = toString (builtins.tail __session);
|
||||||
|
in
|
||||||
|
assert sessionType == "co" || sessionType == "de";
|
||||||
|
if sessionType == "co" then
|
||||||
|
{
|
||||||
|
programs.${session}.enable = true;
|
||||||
|
}
|
||||||
|
else if sessionType == "de" then
|
||||||
|
{ services.desktopManager.${session}.enable = true; }
|
||||||
|
else
|
||||||
|
{ }
|
||||||
|
)
|
||||||
) cfg.usersList)
|
) cfg.usersList)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue