nixos-configs/modules/ags/default.nix

78 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2024-11-13 19:39:01 -05:00
self: {
config,
lib,
2024-12-14 19:36:54 -05:00
pkgs,
2024-11-13 19:39:01 -05:00
...
}: let
2024-12-14 19:36:54 -05:00
inherit (self.inputs) virtualkeyboard-adapter;
2024-11-13 19:39:01 -05:00
inherit (lib) hasPrefix mkIf removePrefix;
# Configs
cfgDesktop = config.roles.desktop;
flakeDir = config.environment.variables.FLAKE;
agsConfigDir = "${removePrefix "/home/${cfgDesktop.user}/" flakeDir}/modules/ags/config";
2024-11-13 19:39:01 -05:00
hmOpts = {lib, ...}: {
options.programs.ags = {
package = lib.mkOption {
type = with lib.types; nullOr package;
default = null;
};
astalLibs = lib.mkOption {
type = with lib.types; nullOr (listOf package);
default = null;
};
lockPkg = lib.mkOption {
type = with lib.types; nullOr package;
default = null;
};
configDir = lib.mkOption {
type = lib.types.str;
default = agsConfigDir;
};
};
};
in {
config = mkIf cfgDesktop.ags.enable {
assertions = [
{
assertion = hasPrefix "/home/${cfgDesktop.user}/" flakeDir;
message = ''
Your $FLAKE environment variable needs to point to a directory in
the main users' home to use the AGS module.
'';
}
];
# Machine config
security.pam.services.astal-auth = {};
services.upower.enable = true;
2024-12-14 19:36:54 -05:00
i18n.inputMethod = mkIf cfgDesktop.isTouchscreen {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
plasma6Support = true;
addons = [
virtualkeyboard-adapter.packages.${pkgs.system}.default
];
};
};
2024-11-13 19:39:01 -05:00
home-manager.users.${cfgDesktop.user}.imports = [
hmOpts
(import ./packages.nix self)
(import ./hyprland.nix self)
2024-11-13 19:39:01 -05:00
];
};
# For accurate stack trace
_file = ./default.nix;
}