nixos-configs/modules/ags/default.nix

83 lines
2 KiB
Nix
Raw Normal View History

2023-11-30 17:17:34 -05:00
{
ags,
config,
pkgs,
...
}: let
inherit (config.vars) mainUser hostName;
2023-11-30 17:17:34 -05:00
isTouchscreen = config.hardware.sensor.iio.enable;
in {
services.upower.enable = true;
home-manager.users.${mainUser}.imports = [
2023-11-30 17:17:34 -05:00
ags.homeManagerModules.default
({
config,
lib,
...
}: let
symlink = config.lib.file.mkOutOfStoreSymlink;
inherit (lib) optionals;
2023-11-30 17:17:34 -05:00
in {
2024-01-27 14:44:50 -05:00
programs.ags.enable = true;
2023-11-30 17:17:34 -05:00
home = {
file = {
2024-01-27 14:44:50 -05:00
".config/ags".source = symlink /home/${mainUser}/.nix/modules/ags/config;
".nix/modules/ags/config/config.js".text =
/*
javascript
*/
''
import { transpileTypeScript } from './js/utils.js';
2023-11-30 17:17:34 -05:00
2024-01-18 09:41:57 -05:00
export default (await transpileTypeScript('${hostName}')).default;
'';
};
2024-01-14 20:52:30 -05:00
packages =
[config.customPkgs.coloryou]
++ (with pkgs; [
# ags
sassc
bun
playerctl
2024-01-14 20:52:30 -05:00
## gui
pavucontrol # TODO: replace with ags widget
])
++ (optionals isTouchscreen (with pkgs; [
lisgd
squeekboard
ydotool
]));
};
wayland.windowManager.hyprland = {
settings = {
exec-once =
[
"ags"
"sleep 3; ags -r 'App.openWindow(\"applauncher\")'"
]
++ optionals isTouchscreen ["squeekboard"];
bindn = [",Escape, exec, ags run-js 'closeAll()'"];
bind = [
"$mainMod SHIFT, E , exec, ags -t powermenu"
"$mainMod , D , exec, ags -t applauncher"
];
binde = [
## Brightness control
", XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'"
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
];
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
};
};
2023-11-30 17:17:34 -05:00
})
];
}