2024-08-02 22:32:29 -04:00
|
|
|
self: {
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (self.inputs) ags astal-tray gtk-session-lock ts-for-gir-src;
|
|
|
|
in {
|
|
|
|
config = let
|
|
|
|
inherit (lib) boolToString mkIf toLower;
|
|
|
|
|
|
|
|
# Configs
|
2024-08-06 20:35:11 -04:00
|
|
|
inherit (config.vars) hostName;
|
2024-08-02 22:32:29 -04:00
|
|
|
cfgDesktop = config.roles.desktop;
|
|
|
|
flakeDir = config.environment.variables.FLAKE;
|
|
|
|
|
|
|
|
# Packages
|
|
|
|
astalTray = astal-tray.packages.${pkgs.system}.tray;
|
|
|
|
gtkSessionLock = gtk-session-lock.packages.${pkgs.system}.default;
|
|
|
|
in
|
|
|
|
mkIf cfgDesktop.ags.enable {
|
|
|
|
# Enable pam for ags
|
|
|
|
security.pam.services.ags = {};
|
|
|
|
|
|
|
|
services.upower.enable = true;
|
|
|
|
|
2024-08-06 20:35:11 -04:00
|
|
|
home-manager.users.${cfgDesktop.user}.imports = [
|
2024-08-02 22:32:29 -04:00
|
|
|
ags.homeManagerModules.default
|
|
|
|
|
|
|
|
({
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (config.lib.file) mkOutOfStoreSymlink;
|
|
|
|
inherit (lib) hasPrefix optionals removePrefix;
|
|
|
|
|
|
|
|
configJs =
|
|
|
|
# javascript
|
|
|
|
''
|
|
|
|
Utils.execAsync('hyprpaper');
|
|
|
|
|
|
|
|
import { transpileTypeScript } from './js/utils.js';
|
|
|
|
|
|
|
|
export default (await transpileTypeScript('${hostName}')).default;
|
|
|
|
'';
|
|
|
|
|
|
|
|
agsPkg = config.programs.ags.finalPackage;
|
2024-08-06 20:35:11 -04:00
|
|
|
agsConfigDir = "${removePrefix "/home/${cfgDesktop.user}/" flakeDir}/nixosModules/ags";
|
2024-08-02 22:32:29 -04:00
|
|
|
in {
|
|
|
|
assertions = [
|
|
|
|
{
|
2024-08-06 20:35:11 -04:00
|
|
|
assertion = hasPrefix "/home/${cfgDesktop.user}/" flakeDir;
|
2024-08-02 22:32:29 -04:00
|
|
|
message = ''
|
|
|
|
Your $FLAKE environment variable needs to point to a directory in
|
|
|
|
the main users' home to use the AGS module.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.ags = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = [
|
|
|
|
astalTray
|
|
|
|
gtkSessionLock
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
home = {
|
|
|
|
file = let
|
2024-08-07 14:47:32 -04:00
|
|
|
inherit (import "${self}/lib" {inherit pkgs;}) buildNodeModules;
|
2024-08-06 20:35:11 -04:00
|
|
|
|
2024-08-02 22:32:29 -04:00
|
|
|
mkType = package: girName: {
|
|
|
|
"${agsConfigDir}/config/types/@girs/${toLower girName}".source =
|
|
|
|
pkgs.callPackage
|
|
|
|
./mk-types {
|
|
|
|
inherit ts-for-gir-src package girName;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in (
|
|
|
|
{
|
|
|
|
# Generated types
|
|
|
|
"${agsConfigDir}/config/types" = {
|
|
|
|
source = "${agsPkg}/share/com.github.Aylur.ags/types";
|
|
|
|
recursive = true; # To add other types inside the folder
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// (mkType gtkSessionLock "GtkSessionLock-0.1")
|
|
|
|
// (mkType astalTray "AstalTray-0.1")
|
|
|
|
// {
|
|
|
|
# Out of store symlinks
|
2024-08-03 20:30:23 -04:00
|
|
|
".config/ags".source = mkOutOfStoreSymlink "${flakeDir}/nixosModules/ags/config";
|
2024-08-02 22:32:29 -04:00
|
|
|
|
|
|
|
# Generated JavaScript files
|
|
|
|
"${agsConfigDir}/config/config.js".text = configJs;
|
|
|
|
"${agsConfigDir}/config/ts/lockscreen/vars.ts".text =
|
|
|
|
# javascript
|
|
|
|
''
|
|
|
|
export default {
|
|
|
|
mainMonitor: '${cfgDesktop.mainMonitor}',
|
|
|
|
dupeLockscreen: ${boolToString cfgDesktop.displayManager.duplicateScreen},
|
|
|
|
hasFprintd: ${boolToString (hostName == "wim")},
|
|
|
|
};
|
|
|
|
'';
|
2024-08-06 20:35:11 -04:00
|
|
|
|
|
|
|
"${agsConfigDir}/config/node_modules".source =
|
|
|
|
buildNodeModules ./config "sha256-Jt7HRrQ8xrpkku51zFbJ44IgPaKKXerZBJUyjo5VudQ=";
|
2024-08-02 22:32:29 -04:00
|
|
|
}
|
|
|
|
// (import ./icons.nix {inherit pkgs agsConfigDir;})
|
|
|
|
);
|
|
|
|
|
|
|
|
packages =
|
|
|
|
[
|
2024-08-31 19:16:06 -04:00
|
|
|
(pkgs.callPackage ./clipboard {})
|
2024-08-02 22:32:29 -04:00
|
|
|
# TODO: replace with matugen
|
|
|
|
self.packages.${pkgs.system}.coloryou
|
|
|
|
]
|
2024-08-31 19:16:06 -04:00
|
|
|
++ (builtins.attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
dart-sass
|
|
|
|
bun
|
|
|
|
playerctl
|
|
|
|
pavucontrol # TODO: replace with ags widget
|
|
|
|
;
|
|
|
|
})
|
|
|
|
++ (optionals cfgDesktop.isTouchscreen (builtins.attrValues {
|
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
lisgd
|
|
|
|
ydotool
|
|
|
|
;
|
|
|
|
}));
|
2024-08-02 22:32:29 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
wayland.windowManager.hyprland = {
|
|
|
|
settings = {
|
|
|
|
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-).*"
|
|
|
|
|
|
|
|
# Lockscreen blur
|
|
|
|
"blur, ^(blur-bg.*)"
|
|
|
|
"ignorealpha 0.19, ^(blur-bg.*)"
|
|
|
|
];
|
|
|
|
|
|
|
|
exec-once = [
|
|
|
|
"ags"
|
|
|
|
"sleep 3; ags -r 'App.openWindow(\"win-applauncher\")'"
|
|
|
|
];
|
|
|
|
|
|
|
|
bind = [
|
|
|
|
"$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"
|
|
|
|
];
|
|
|
|
binde = [
|
|
|
|
## Brightness control
|
|
|
|
", XF86MonBrightnessUp , exec, ags -r 'Brightness.screen += 0.05'"
|
|
|
|
", XF86MonBrightnessDown, exec, ags -r 'Brightness.screen -= 0.05'"
|
|
|
|
];
|
|
|
|
bindn = [" , Escape , exec, ags -r 'closeAll()'"];
|
|
|
|
bindr = ["CAPS, Caps_Lock, exec, ags -r 'Brightness.fetchCapsState()'"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./default.nix;
|
|
|
|
}
|