parent
1fc5a48bf9
commit
f522c984c4
64 changed files with 182 additions and 50 deletions
nixosModules/desktop
|
@ -44,6 +44,14 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
ags-v2.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether we want to enable AGSv2 for the DE shell.
|
||||
'';
|
||||
};
|
||||
|
||||
mainMonitor = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
|
|
|
@ -8,6 +8,7 @@ self: {
|
|||
in {
|
||||
imports = [
|
||||
(import ../../ags self)
|
||||
(import ../../ags-v2 self)
|
||||
|
||||
./modules/dconf.nix
|
||||
./modules/printer.nix
|
||||
|
|
|
@ -10,14 +10,26 @@
|
|||
cfg = config.roles.desktop;
|
||||
|
||||
hmCfg = config.home-manager.users.${cfg.user};
|
||||
agsPkg = hmCfg.programs.ags.finalPackage;
|
||||
hyprPkg = hmCfg.wayland.windowManager.hyprland.finalPackage;
|
||||
|
||||
lockPkg =
|
||||
if cfg.ags.enable
|
||||
then
|
||||
pkgs.writeShellApplication {
|
||||
name = "lock";
|
||||
runtimeInputs = [hmCfg.programs.ags.finalPackage];
|
||||
|
||||
text = ''
|
||||
ags -r 'Tablet.setLaptopMode()'
|
||||
ags -b lockscreen -c /home/${cfg.user}/.config/ags/lockscreen.js
|
||||
'';
|
||||
}
|
||||
else hmCfg.programs.ags-v2.lockPkg;
|
||||
|
||||
runInDesktop = pkgs.writeShellApplication {
|
||||
name = "runInDesktop";
|
||||
runtimeInputs = [
|
||||
pkgs.sudo
|
||||
agsPkg
|
||||
hyprPkg
|
||||
];
|
||||
|
||||
|
@ -38,18 +50,6 @@
|
|||
done
|
||||
'';
|
||||
};
|
||||
|
||||
lockPkg = pkgs.writeShellApplication {
|
||||
name = "lock";
|
||||
runtimeInputs = [
|
||||
agsPkg
|
||||
];
|
||||
|
||||
text = ''
|
||||
ags -r 'Tablet.setLaptopMode()'
|
||||
ags -b lockscreen -c /home/${cfg.user}/.config/ags/lockscreen.js
|
||||
'';
|
||||
};
|
||||
in {
|
||||
services.acpid = mkIf cfg.isLaptop {
|
||||
enable = true;
|
||||
|
@ -62,7 +62,7 @@
|
|||
|
||||
case "$state" in
|
||||
*open*)
|
||||
${getExe runInDesktop} "ags -b lockscreen -r 'authFinger()'"
|
||||
${getExe runInDesktop} "${getExe lockPkg} -m 'authFinger()'"
|
||||
;;
|
||||
|
||||
*close*)
|
||||
|
|
|
@ -29,7 +29,9 @@ in {
|
|||
home-manager.users.${cfg.user}.home.file = let
|
||||
flakeDir = config.environment.variables.FLAKE;
|
||||
modulesDir = "${lib.removePrefix "/home/${cfg.user}/" flakeDir}/nixosModules";
|
||||
nodeModules = config.home-manager.users.${cfg.user}.home.file."${modulesDir}/ags/config/node_modules".source;
|
||||
nodeModules =
|
||||
config.home-manager.users.${cfg.user}.home.file."${modulesDir}/ags/config/node_modules".source
|
||||
or config.home-manager.users.${cfg.user}.home.file."${modulesDir}/ags-v2/config/node_modules".source;
|
||||
in {
|
||||
"${modulesDir}/desktop/manager/ags/node_modules".source = nodeModules;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue