2023-11-30 17:17:34 -05:00
|
|
|
{
|
|
|
|
ags,
|
2024-07-08 21:15:11 -04:00
|
|
|
astal-tray,
|
2023-11-30 17:17:34 -05:00
|
|
|
config,
|
2024-04-19 10:38:54 -04:00
|
|
|
gtk-session-lock,
|
2024-04-19 20:31:17 -04:00
|
|
|
lib,
|
2023-11-30 17:17:34 -05:00
|
|
|
pkgs,
|
2024-06-08 22:21:04 -04:00
|
|
|
self,
|
2023-11-30 17:17:34 -05:00
|
|
|
...
|
|
|
|
}: let
|
2024-04-19 20:31:17 -04:00
|
|
|
inherit (lib) boolToString;
|
2024-07-08 21:15:11 -04:00
|
|
|
|
|
|
|
# Configs
|
2024-06-27 00:56:27 -04:00
|
|
|
inherit (config.vars) mainUser hostName;
|
|
|
|
cfgDesktop = config.roles.desktop;
|
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;
|
2024-07-08 21:15:11 -04:00
|
|
|
|
|
|
|
# Packages
|
|
|
|
astalTray = astal-tray.packages.${pkgs.system}.tray;
|
2024-04-19 17:01:09 -04:00
|
|
|
gtkSessionLock = gtk-session-lock.packages.${pkgs.system}.default;
|
2023-11-30 17:17:34 -05:00
|
|
|
in {
|
2024-03-05 19:37:09 -05:00
|
|
|
# Enable pam for ags and astal
|
|
|
|
security.pam.services.ags = {};
|
|
|
|
|
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
|
|
|
|
|
|
|
|
({
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-07-08 21:15:11 -04:00
|
|
|
inherit (config.lib.file) mkOutOfStoreSymlink;
|
2024-06-24 12:30:49 -04:00
|
|
|
inherit (lib) hasPrefix optionals removePrefix;
|
2024-03-22 23:31:37 -04:00
|
|
|
|
|
|
|
configJs =
|
2024-06-09 22:49:30 -04:00
|
|
|
# javascript
|
2024-03-22 23:31:37 -04:00
|
|
|
''
|
|
|
|
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;
|
2024-06-24 12:30:49 -04:00
|
|
|
message = ''
|
2024-03-26 15:32:48 -04:00
|
|
|
Your $FLAKE environment variable needs to point to a directory in
|
|
|
|
the main users' home to use the AGS module.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-04-19 10:38:54 -04:00
|
|
|
programs.ags = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = [
|
2024-07-08 21:15:11 -04:00
|
|
|
astalTray
|
2024-04-19 17:01:09 -04:00
|
|
|
gtkSessionLock
|
2024-04-19 10:38:54 -04:00
|
|
|
];
|
|
|
|
};
|
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-07-08 21:15:11 -04:00
|
|
|
# Out of store symlinks
|
|
|
|
".config/ags".source = mkOutOfStoreSymlink "${flakeDir}/modules/ags/config";
|
2024-03-05 19:36:25 -05:00
|
|
|
|
2024-07-08 21:15:11 -04:00
|
|
|
# Generated types
|
2024-04-19 10:38:54 -04:00
|
|
|
"${agsConfigDir}/config/types" = {
|
|
|
|
source = "${config.programs.ags.finalPackage}/share/com.github.Aylur.ags/types";
|
2024-07-08 21:15:11 -04:00
|
|
|
recursive = true; # To add other types inside the folder
|
2024-04-19 10:38:54 -04:00
|
|
|
};
|
2024-07-08 21:15:11 -04:00
|
|
|
"${agsConfigDir}/config/types/gtk-session-lock".source =
|
|
|
|
pkgs.callPackage ./third-party-types/lock.nix {inherit gtkSessionLock;};
|
|
|
|
"${agsConfigDir}/config/types/astal-tray".source =
|
|
|
|
pkgs.callPackage ./third-party-types/tray.nix {inherit astalTray;};
|
2024-04-19 20:31:17 -04:00
|
|
|
|
2024-07-08 21:15:11 -04:00
|
|
|
# Generated JavaScript files
|
|
|
|
"${agsConfigDir}/config/config.js".text = configJs;
|
2024-04-19 20:31:17 -04:00
|
|
|
"${agsConfigDir}/config/ts/lockscreen/vars.ts".text =
|
2024-06-09 22:49:30 -04:00
|
|
|
# javascript
|
2024-04-19 20:31:17 -04:00
|
|
|
''
|
|
|
|
export default {
|
2024-06-27 00:56:27 -04:00
|
|
|
mainMonitor: '${cfgDesktop.mainMonitor}',
|
|
|
|
dupeLockscreen: ${boolToString cfgDesktop.displayManager.duplicateScreen},
|
2024-04-19 20:43:43 -04:00
|
|
|
hasFprintd: ${boolToString (hostName == "wim")},
|
2024-04-19 20:31:17 -04:00
|
|
|
};
|
|
|
|
'';
|
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 =
|
2024-07-10 13:55:45 -04:00
|
|
|
[
|
|
|
|
# TODO: replace with matugen
|
|
|
|
self.packages.${pkgs.system}.coloryou
|
|
|
|
]
|
2024-01-17 19:18:41 -05:00
|
|
|
++ (with pkgs; [
|
|
|
|
# ags
|
2024-03-06 15:44:25 -05:00
|
|
|
dart-sass
|
2024-01-17 19:18:41 -05:00
|
|
|
bun
|
|
|
|
playerctl
|
2024-05-01 10:21:28 -04:00
|
|
|
(callPackage ./clipboard {})
|
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
|
|
|
|
ydotool
|
|
|
|
]));
|
|
|
|
};
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
settings = {
|
2024-04-07 14:29:12 -04:00
|
|
|
animations = {
|
|
|
|
bezier = [
|
|
|
|
"easeInOutBack, 0.68, -0.6, 0.32, 1.6"
|
|
|
|
];
|
|
|
|
|
|
|
|
animation = [
|
|
|
|
"fadeLayersIn, 0"
|
|
|
|
"fadeLayersOut, 1, 3000, default"
|
|
|
|
"layers, 1, 8, easeInOutBack, slide left"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
layerrule = [
|
|
|
|
"noanim, ^(?!win-).*"
|
2024-04-19 20:31:17 -04:00
|
|
|
|
|
|
|
# Lockscreen blur
|
2024-04-19 17:01:09 -04:00
|
|
|
"blur, ^(blur-bg.*)"
|
|
|
|
"ignorealpha 0.19, ^(blur-bg.*)"
|
2024-03-28 14:47:07 -04:00
|
|
|
];
|
|
|
|
|
2024-04-07 11:34:44 -04:00
|
|
|
exec-once = [
|
|
|
|
"ags"
|
2024-04-07 14:29:12 -04:00
|
|
|
"sleep 3; ags -r 'App.openWindow(\"win-applauncher\")'"
|
2024-04-07 11:34:44 -04:00
|
|
|
];
|
2024-02-05 09:56:42 -05:00
|
|
|
|
|
|
|
bind = [
|
2024-05-05 22:43:03 -04:00
|
|
|
"$mainMod SHIFT, E , exec, ags -t win-powermenu"
|
|
|
|
"$mainMod , D , exec, ags -t win-applauncher"
|
|
|
|
"$mainMod , V , exec, ags -t win-clipboard"
|
|
|
|
" , Print, exec, ags -t win-screenshot"
|
2024-02-05 09:56:42 -05:00
|
|
|
];
|
|
|
|
binde = [
|
|
|
|
## Brightness control
|
2024-05-05 22:43:03 -04: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-05-05 22:43:03 -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
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|