From 9fb7bb1ae1bc3e3f703fa7c2c9b5eca9639cf1e4 Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sat, 3 Aug 2024 08:06:17 -0700 Subject: [PATCH] Converted playerctl to a home module --- homes/x86_64-linux/alejandro/default.nix | 1 + modules/home/services/playerctld/default.nix | 20 +++++++++++++++++ .../desktop/addons/playerctl/default.nix | 22 ------------------- modules/nixos/desktop/sway/default.nix | 1 - 4 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 modules/home/services/playerctld/default.nix delete mode 100644 modules/nixos/desktop/addons/playerctl/default.nix diff --git a/homes/x86_64-linux/alejandro/default.nix b/homes/x86_64-linux/alejandro/default.nix index f23782d..65dc2cb 100644 --- a/homes/x86_64-linux/alejandro/default.nix +++ b/homes/x86_64-linux/alejandro/default.nix @@ -31,6 +31,7 @@ services = { swaync.enable = true; + playerctld.enable = true; }; }; } diff --git a/modules/home/services/playerctld/default.nix b/modules/home/services/playerctld/default.nix new file mode 100644 index 0000000..6a1db73 --- /dev/null +++ b/modules/home/services/playerctld/default.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + pkgs, + namespace, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.${namespace}.services.playerctld; +in { + options.${namespace}.services.playerctld = { + enable = mkEnableOption "playerctl"; + }; + + config = mkIf cfg.enable { + home.packages = [pkgs.playerctl]; + services.playerctld.enable = true; + }; +} diff --git a/modules/nixos/desktop/addons/playerctl/default.nix b/modules/nixos/desktop/addons/playerctl/default.nix deleted file mode 100644 index a36d0a7..0000000 --- a/modules/nixos/desktop/addons/playerctl/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - options, - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.aa.desktop.addons.playerctl; -in { - options.aa.desktop.addons.playerctl = with types; { - enable = mkEnableOption "playerctl"; - }; - - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [playerctl]; - - aa.home.extraOptions = { - services.playerctld.enable = true; - }; - }; -} diff --git a/modules/nixos/desktop/sway/default.nix b/modules/nixos/desktop/sway/default.nix index 0f566d6..b857932 100644 --- a/modules/nixos/desktop/sway/default.nix +++ b/modules/nixos/desktop/sway/default.nix @@ -38,7 +38,6 @@ in { aa.desktop.addons = { alacritty.enable = true; gammastep.enable = true; - playerctl.enable = true; swayidle.enable = true; # TODO