refactor(ags): make global module

This commit is contained in:
matt1432 2023-11-30 17:17:34 -05:00
parent b4648912f5
commit 6028e3679a
7 changed files with 61 additions and 83 deletions

View file

@ -2,6 +2,7 @@
imports = [
./hardware-configuration.nix
../../modules/ags
../../modules/audio.nix
../../modules/greetd
../../modules/kmscon.nix
@ -30,7 +31,6 @@
"input"
"uinput"
"adm"
"mlocate"
"video"
"libvirtd"
];
@ -42,7 +42,6 @@
../../home/firefox
../../home/hyprland
./home/ags.nix
./home/packages.nix
];

View file

@ -1,31 +0,0 @@
{
pkgs,
config,
ags,
...
}: let
configDir = config.services.device-vars.configDir;
symlink = config.lib.file.mkOutOfStoreSymlink;
in {
imports = [
ags.homeManagerModules.default
];
programs.ags = {
enable = true;
configDir = symlink "${configDir}/ags";
package = ags.packages.x86_64-linux.default;
extraPackages = [pkgs.libgudev];
};
home.packages = with pkgs; [
# ags
sassc
coloryou
playerctl
## gui
pavucontrol # TODO: replace with ags widget
networkmanagerapplet # TODO: replace with ags widget
];
}

View file

@ -16,7 +16,6 @@
extraGroups = [
"wheel"
"adm"
"mlocate"
];
};
home-manager.users = {

View file

@ -2,6 +2,7 @@
imports = [
./hardware-configuration.nix
../../modules/ags
../../modules/audio.nix
../../modules/greetd
../../modules/kmscon.nix
@ -27,7 +28,6 @@
"input"
"uinput"
"adm"
"mlocate"
"video"
"libvirtd"
];
@ -41,7 +41,6 @@
./home/dotfiles.nix
./home/packages.nix
./home/ags.nix
];
# No touchy

View file

@ -1,47 +0,0 @@
{
pkgs,
config,
ags,
...
}: let
configDir = config.services.device-vars.configDir;
symlink = config.lib.file.mkOutOfStoreSymlink;
in {
imports = [
ags.homeManagerModules.default
];
programs.ags = {
enable = true;
configDir = symlink "${configDir}/ags";
package = ags.packages.x86_64-linux.default;
extraPackages = [pkgs.libgudev];
};
wayland.windowManager.hyprland = {
settings = {
env = [
"AGS_PATH, ${configDir}/ags/bin"
"HYPR_PATH, ${configDir}/hypr/scripts"
"LOCK_PATH, ${configDir}/gtklock/scripts"
];
};
};
home.packages = with pkgs; [
# ags
ydotool
sassc
coloryou
playerctl
## gui
pavucontrol # TODO: replace with ags widget
networkmanagerapplet # TODO: replace with ags widget
blueberry # TODO: replace with ags widget
# touchscreen
lisgd
squeekboard
];
}

View file

@ -6,6 +6,16 @@
configDir = config.services.device-vars.configDir;
symlink = config.lib.file.mkOutOfStoreSymlink;
in {
wayland.windowManager.hyprland = {
settings = {
env = [
"AGS_PATH, ${configDir}/ags/bin"
"HYPR_PATH, ${configDir}/hypr/scripts"
"LOCK_PATH, ${configDir}/gtklock/scripts"
];
};
};
xdg.configFile = {
"gtklock/config.ini".source = pkgs.writeText "config.ini" ''
[main]

49
modules/ags/default.nix Normal file
View file

@ -0,0 +1,49 @@
{
ags,
config,
pkgs,
...
}: let
vars = config.services.device-vars;
isNvidia = config.hardware.nvidia.modesetting.enable;
isTouchscreen = config.hardware.sensor.iio.enable;
in {
services.upower.enable = true;
home-manager.users.${vars.username}.imports = [
ags.homeManagerModules.default
({
config,
lib,
...
}: let
symlink = config.lib.file.mkOutOfStoreSymlink;
optionals = lib.lists.optionals;
in {
programs.ags = {
enable = true;
configDir = symlink "${vars.configDir}/ags";
package = ags.packages.x86_64-linux.default;
extraPackages = [pkgs.libgudev];
};
home.packages = with pkgs;
[
# ags
sassc
coloryou
playerctl
## gui
pavucontrol # TODO: replace with ags widget
networkmanagerapplet # TODO: replace with ags widget
]
++ (optionals isTouchscreen [
# touchscreen
lisgd
squeekboard
]);
})
];
}