nixos-configs/modules/ags/default.nix

78 lines
1.8 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;
optionals = lib.lists.optionals;
in {
programs.ags = {
enable = true;
configDir = symlink /home/${mainUser}/.nix/modules/ags/config;
2023-12-08 12:48:48 -05:00
package = ags.packages.${pkgs.system}.default;
2023-11-30 17:17:34 -05:00
};
home = {
file = {
".config/ags/config.js".text =
/*
javascript
*/
''
import { transpileTypeScript } from './js/utils.js';
2023-11-30 17:17:34 -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
2024-01-14 20:52:30 -05:00
(writeShellApplication {
name = "updateTypes";
runtimeInputs = [nodejs_18 typescript git];
text = ''
if [[ -d /tmp/ags-types ]]; then
rm -r /tmp/ags-types
fi
rm -r ~/.config/ags/types
git clone https://github.com/Aylur/ags.git /tmp/ags-types
/tmp/ags-types/example/starter-config/setup.sh
rm -r /tmp/ags-types
'';
})
])
++ (optionals isTouchscreen (with pkgs; [
lisgd
squeekboard
ydotool
]));
};
2023-11-30 17:17:34 -05:00
})
];
}