2024-11-11 20:33:44 -05:00
|
|
|
self: {
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
2024-11-12 16:55:57 -05:00
|
|
|
}: {
|
2024-11-11 20:33:44 -05:00
|
|
|
config = let
|
|
|
|
# Libs
|
2024-11-12 16:55:57 -05:00
|
|
|
inherit (lib) removePrefix;
|
2024-11-11 20:33:44 -05:00
|
|
|
|
2024-11-12 16:55:57 -05:00
|
|
|
cfg = config.roles.desktop;
|
|
|
|
hmCfg = config.home-manager.users.${cfg.user};
|
2024-11-11 20:33:44 -05:00
|
|
|
|
2024-11-12 16:55:57 -05:00
|
|
|
ags = hmCfg.programs.ags-v2.package;
|
|
|
|
hyprland = hmCfg.wayland.windowManager.hyprland.finalPackage;
|
2024-11-11 20:33:44 -05:00
|
|
|
|
|
|
|
agsConfig = let
|
2024-11-12 16:55:57 -05:00
|
|
|
homeFiles = config.home-manager.users.${cfg.user}.home.file;
|
|
|
|
agsDir = "${removePrefix "/home/${cfg.user}/" config.environment.variables.FLAKE}/nixosModules/ags-v2/config";
|
2024-11-11 20:33:44 -05:00
|
|
|
|
2024-11-12 16:55:57 -05:00
|
|
|
nodeModules = homeFiles."${agsDir}/node_modules".source;
|
|
|
|
tsconfig = homeFiles."${agsDir}/tsconfig.json".source;
|
|
|
|
varsTs = homeFiles."${agsDir}/widgets/lockscreen/vars.ts".source;
|
2024-11-11 20:33:44 -05:00
|
|
|
in
|
|
|
|
pkgs.runCommandLocal "agsConfig" {} ''
|
|
|
|
cp -ar ${tsconfig} ./tsconfig.json
|
|
|
|
cp -ar ${../../ags-v2/config}/* ./.
|
|
|
|
chmod +w -R ./.
|
|
|
|
cp -ar ${varsTs} ./widgets/lockscreen/vars.ts
|
|
|
|
cp -ar ${nodeModules} ./node_modules
|
2024-11-12 16:55:57 -05:00
|
|
|
${ags}/bin/ags bundle ./app.ts $out
|
2024-11-11 20:33:44 -05:00
|
|
|
'';
|
|
|
|
in {
|
2024-11-12 16:55:57 -05:00
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = cfg.ags-v2.enable;
|
|
|
|
message = ''
|
|
|
|
The Display Manager requires AGSv2 to be enabled.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-11-11 20:33:44 -05:00
|
|
|
# Add home folder for home-manager to work
|
|
|
|
users.users.greeter = {
|
|
|
|
home = "/var/lib/greeter";
|
|
|
|
createHome = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.greeter = {
|
|
|
|
home.packages = [
|
|
|
|
hyprland
|
|
|
|
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "agsGreeter";
|
|
|
|
|
|
|
|
runtimeInputs = [
|
2024-11-12 16:55:57 -05:00
|
|
|
ags
|
2024-11-11 20:33:44 -05:00
|
|
|
hyprland
|
|
|
|
];
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
export CONF="greeter"
|
|
|
|
exec ags run ${agsConfig}
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./default.nix;
|
|
|
|
}
|