From 6028e3679a9ea3fa267f9fd863ec008c98291a4b Mon Sep 17 00:00:00 2001 From: matt1432 Date: Thu, 30 Nov 2023 17:17:34 -0500 Subject: [PATCH] refactor(ags): make global module --- devices/binto/default.nix | 3 +-- devices/binto/home/ags.nix | 31 ---------------------- devices/oksys/default.nix | 1 - devices/wim/default.nix | 3 +-- devices/wim/home/ags.nix | 47 --------------------------------- devices/wim/home/dotfiles.nix | 10 +++++++ modules/ags/default.nix | 49 +++++++++++++++++++++++++++++++++++ 7 files changed, 61 insertions(+), 83 deletions(-) delete mode 100644 devices/binto/home/ags.nix delete mode 100644 devices/wim/home/ags.nix create mode 100644 modules/ags/default.nix diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 5064e14d..30da64d6 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -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 ]; diff --git a/devices/binto/home/ags.nix b/devices/binto/home/ags.nix deleted file mode 100644 index 34c32a60..00000000 --- a/devices/binto/home/ags.nix +++ /dev/null @@ -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 - ]; -} diff --git a/devices/oksys/default.nix b/devices/oksys/default.nix index fd202be7..da2d7e2c 100644 --- a/devices/oksys/default.nix +++ b/devices/oksys/default.nix @@ -16,7 +16,6 @@ extraGroups = [ "wheel" "adm" - "mlocate" ]; }; home-manager.users = { diff --git a/devices/wim/default.nix b/devices/wim/default.nix index 88caca61..92080884 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -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 diff --git a/devices/wim/home/ags.nix b/devices/wim/home/ags.nix deleted file mode 100644 index 8036355c..00000000 --- a/devices/wim/home/ags.nix +++ /dev/null @@ -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 - ]; -} diff --git a/devices/wim/home/dotfiles.nix b/devices/wim/home/dotfiles.nix index 584c9b01..3edea35b 100644 --- a/devices/wim/home/dotfiles.nix +++ b/devices/wim/home/dotfiles.nix @@ -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] diff --git a/modules/ags/default.nix b/modules/ags/default.nix new file mode 100644 index 00000000..a994fc3a --- /dev/null +++ b/modules/ags/default.nix @@ -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 + ]); + }) + ]; +}