2023-11-30 17:17:34 -05:00
|
|
|
{
|
|
|
|
ags,
|
2024-03-05 19:37:09 -05:00
|
|
|
astal,
|
2023-11-30 17:17:34 -05:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-01-17 19:18:41 -05:00
|
|
|
inherit (config.vars) mainUser hostName;
|
2024-02-05 09:56:42 -05:00
|
|
|
|
2024-03-26 13:55:55 -04:00
|
|
|
flakeDir = config.environment.variables.FLAKE;
|
2023-11-30 17:17:34 -05:00
|
|
|
isTouchscreen = config.hardware.sensor.iio.enable;
|
|
|
|
in {
|
2024-03-05 19:37:09 -05:00
|
|
|
# Enable pam for ags and astal
|
|
|
|
security.pam.services.ags = {};
|
|
|
|
security.pam.services.astal = {};
|
|
|
|
|
2023-11-30 17:17:34 -05:00
|
|
|
services.upower.enable = true;
|
|
|
|
|
2024-01-09 13:13:04 -05:00
|
|
|
home-manager.users.${mainUser}.imports = [
|
2023-11-30 17:17:34 -05:00
|
|
|
ags.homeManagerModules.default
|
2024-03-05 19:37:09 -05:00
|
|
|
astal.homeManagerModules.default
|
2023-11-30 17:17:34 -05:00
|
|
|
|
|
|
|
({
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
symlink = config.lib.file.mkOutOfStoreSymlink;
|
2024-03-26 15:32:48 -04:00
|
|
|
inherit (lib) hasPrefix mdDoc optionals removePrefix;
|
2024-03-22 23:31:37 -04:00
|
|
|
|
|
|
|
configJs =
|
|
|
|
/*
|
|
|
|
javascript
|
|
|
|
*/
|
|
|
|
''
|
|
|
|
import { transpileTypeScript } from './js/utils.js';
|
|
|
|
|
|
|
|
export default (await transpileTypeScript('${hostName}')).default;
|
|
|
|
'';
|
2024-03-26 15:32:48 -04:00
|
|
|
|
|
|
|
agsConfigDir = "${removePrefix "/home/${mainUser}/" flakeDir}/modules/ags";
|
2023-11-30 17:17:34 -05:00
|
|
|
in {
|
2024-03-26 15:32:48 -04:00
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = hasPrefix "/home/${mainUser}/" flakeDir;
|
|
|
|
message = mdDoc ''
|
|
|
|
Your $FLAKE environment variable needs to point to a directory in
|
|
|
|
the main users' home to use the AGS module.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-03-05 19:37:09 -05:00
|
|
|
# Experimental Gtk4 ags
|
|
|
|
programs.astal = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
libadwaita
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-01-27 14:44:50 -05:00
|
|
|
programs.ags.enable = true;
|
2023-11-30 17:17:34 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
home = {
|
2024-03-05 19:36:25 -05:00
|
|
|
file =
|
|
|
|
{
|
2024-03-26 15:32:48 -04:00
|
|
|
# Astal symlinks. ${./astal}, types and config.js
|
2024-03-26 13:55:55 -04:00
|
|
|
".config/astal".source = symlink "${flakeDir}/modules/ags/astal";
|
2024-03-26 15:32:48 -04:00
|
|
|
"${agsConfigDir}/astal/types".source = "${config.programs.astal.finalPackage}/share/io.Aylur.Astal/types";
|
|
|
|
"${agsConfigDir}/astal/config.js".text = configJs;
|
2024-03-05 19:36:25 -05:00
|
|
|
|
2024-03-26 15:32:48 -04:00
|
|
|
# AGS symlinks. ${./config}, types and config.js
|
2024-03-26 13:55:55 -04:00
|
|
|
".config/ags".source = symlink "${flakeDir}/modules/ags/config";
|
2024-03-26 15:32:48 -04:00
|
|
|
"${agsConfigDir}/config/types".source = "${config.programs.ags.finalPackage}/share/com.github.Aylur.ags/types";
|
|
|
|
"${agsConfigDir}/config/config.js".text = configJs;
|
2024-03-05 19:36:25 -05:00
|
|
|
}
|
|
|
|
// (import ./icons.nix {inherit pkgs agsConfigDir;});
|
2024-01-14 20:52:30 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
packages =
|
|
|
|
[config.customPkgs.coloryou]
|
|
|
|
++ (with pkgs; [
|
|
|
|
# ags
|
2024-03-06 15:44:25 -05:00
|
|
|
dart-sass
|
2024-01-17 19:18:41 -05:00
|
|
|
bun
|
|
|
|
playerctl
|
2024-01-14 20:52:30 -05:00
|
|
|
|
2024-01-17 19:18:41 -05:00
|
|
|
## gui
|
|
|
|
pavucontrol # TODO: replace with ags widget
|
|
|
|
])
|
|
|
|
++ (optionals isTouchscreen (with pkgs; [
|
|
|
|
lisgd
|
|
|
|
squeekboard
|
|
|
|
ydotool
|
|
|
|
]));
|
|
|
|
};
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
settings = {
|
2024-03-28 14:47:07 -04:00
|
|
|
animations.animation = [
|
|
|
|
# Ags takes care of doing the animations
|
|
|
|
"layers, 0"
|
|
|
|
];
|
|
|
|
|
2024-02-05 10:37:56 -05:00
|
|
|
exec-once =
|
|
|
|
[
|
|
|
|
"ags"
|
|
|
|
"sleep 3; ags -r 'App.openWindow(\"applauncher\")'"
|
|
|
|
]
|
|
|
|
++ optionals isTouchscreen ["squeekboard"];
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
bind = [
|
2024-03-26 15:32:48 -04:00
|
|
|
"$mainMod SHIFT, E, exec, ags -t powermenu"
|
|
|
|
"$mainMod , D, exec, ags -t applauncher"
|
2024-02-05 09:56:42 -05:00
|
|
|
];
|
|
|
|
binde = [
|
|
|
|
## Brightness control
|
2024-02-26 16:28:54 -05:00
|
|
|
", XF86MonBrightnessUp, exec, ags -r 'Brightness.screen += 0.05'"
|
2024-02-05 09:56:42 -05:00
|
|
|
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
|
|
|
|
];
|
2024-03-26 15:32:48 -04:00
|
|
|
bindn = [" , Escape, exec, ags -r 'closeAll()'"];
|
2024-02-05 09:56:42 -05:00
|
|
|
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
|
|
|
|
};
|
|
|
|
};
|
2023-11-30 17:17:34 -05:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|