diff --git a/flake.nix b/flake.nix index f42c2ef..11c60e6 100755 --- a/flake.nix +++ b/flake.nix @@ -2,42 +2,17 @@ description = "My personal dotfiles"; inputs = { - nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "nixpkgs/nixos-23.11"; + home-manager.url = "github:nix-community/home-manager/release-23.11"; + nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable"; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + chaotic-nyx.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + nix-index-database.url = "github:Mic92/nix-index-database"; - chaotic-nyx = { - url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix-index-database = { - url = "github:Mic92/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hyprland = { - url = "github:hyprwm/hyprland"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hyprland-contrib = { - url = "github:hyprwm/contrib"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - hyprpicker = { - url = "github:hyprwm/hyprpicker"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - ags = { - url = "github:Aylur/ags"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + hyprland.url = "github:hyprwm/hyprland"; + hyprland-contrib.url = "github:hyprwm/contrib"; + hyprpicker.url = "github:hyprwm/hyprpicker"; + ags.url = "github:Aylur/ags"; gruvbox-kvantum = { url = "github:thefallnn/Gruvbox-Kvantum"; @@ -54,11 +29,6 @@ flake = false; }; - nixd = { - url = "github:nix-community/nixd"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nvim-hmts = { url = "github:calops/hmts.nvim"; flake = false; diff --git a/overlay.nix b/overlay.nix index f437641..85a5c0d 100755 --- a/overlay.nix +++ b/overlay.nix @@ -26,6 +26,10 @@ # dontWrapQtApps = false; # }); + kitty = prev.kitty.overrideAttrs (old: { + patches = [./pkgs/kitty/0011-fix-test_fish_integration.patch]; + }); + steam = prev.steam.override { extraPkgs = prev: [ prev.libkrb5 diff --git a/pkgs/gruvbox-plus-icon-pack/default.nix b/pkgs/gruvbox-plus-icon-pack/default.nix index 4e1cdeb..3dddb9a 100755 --- a/pkgs/gruvbox-plus-icon-pack/default.nix +++ b/pkgs/gruvbox-plus-icon-pack/default.nix @@ -3,6 +3,7 @@ fetchFromGitHub, inputs, gtk3, + fd, gnome-icon-theme, hicolor-icon-theme, }: @@ -12,15 +13,22 @@ stdenvNoCC.mkDerivation rec { src = inputs.gruvbox-plus-icon-pack; - nativeBuildInputs = [gtk3]; + nativeBuildInputs = [gtk3 fd]; propagatedBuildInputs = [gnome-icon-theme hicolor-icon-theme]; installPhase = '' cd Gruvbox-Plus-Dark + fd " " -X rm mkdir -p $out/share/icons/Gruvbox-Plus-Dark cp -r * $out/share/icons/Gruvbox-Plus-Dark ''; + postFixup = '' + for i in $out/share/icons/*; do + gtk-update-icon-cache $i + done + ''; + dontDropIconThemeCache = true; } diff --git a/pkgs/kitty/0011-fix-test_fish_integration.patch b/pkgs/kitty/0011-fix-test_fish_integration.patch new file mode 100644 index 0000000..eb4648c --- /dev/null +++ b/pkgs/kitty/0011-fix-test_fish_integration.patch @@ -0,0 +1,22 @@ +From 4c56e768401f920bb3ce129e1883810b7e6323f7 Mon Sep 17 00:00:00 2001 +From: Kovid Goyal +Date: Sat, 11 Nov 2023 20:00:46 +0530 +Subject: [PATCH] Fix #6812 + +--- + .../fish/vendor_conf.d/kitty-shell-integration.fish | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish +index 77fc837c49..5f09988fb0 100644 +--- a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish ++++ b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish +@@ -111,7 +111,7 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after + # Note that neither alias nor function is recursive in fish so if the user defines an alias/function + # for sudo it will be clobbered by us, so only install this if sudo is not already function + if not contains "no-sudo" $_ksi +- and test -n "$TERMINFO" -a "file" = (type -t sudo) ++ and test -n "$TERMINFO" -a "file" = (type -t sudo 2> /dev/null || echo "x") + and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty" + # Ensure terminfo is available in sudo + function sudo diff --git a/system/hardware-configuration.nix b/system/hardware-configuration.nix index 3dea015..d4b6cac 100644 --- a/system/hardware-configuration.nix +++ b/system/hardware-configuration.nix @@ -18,12 +18,12 @@ boot.extraModulePackages = []; fileSystems."/" = { - device = "/dev/disk/by-uuid/d57d2104-d36b-4fc9-9acd-4dd3807fb290"; + device = "/dev/disk/by-uuid/7009c691-ca34-4106-b959-0d625aefb30b"; fsType = "xfs"; }; fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D84B-2DD9"; + device = "/dev/disk/by-uuid/3A8C-A960"; fsType = "vfat"; }; diff --git a/system/services/avahi/default.nix b/system/services/avahi/default.nix deleted file mode 100644 index 4ad4613..0000000 --- a/system/services/avahi/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - services.avahi = { - enable = true; - nssmdns = true; - }; -} diff --git a/system/services/default.nix b/system/services/default.nix index aa0f69d..36c9e86 100644 --- a/system/services/default.nix +++ b/system/services/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./avahi ./locate ./pipewire ./podman @@ -10,10 +9,10 @@ ]; services = { + avahi.enable = true; blueman.enable = true; flatpak.enable = true; - # fwupd.enable = true; - gnome.gnome-keyring.enable = true; + # gnome.gnome-keyring.enable = true; gvfs.enable = true; openssh.enable = true; udisks2.enable = true; diff --git a/system/services/podman/default.nix b/system/services/podman/default.nix index a48933f..a2ac480 100644 --- a/system/services/podman/default.nix +++ b/system/services/podman/default.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { virtualisation = { podman = { enable = true; diff --git a/user/configs/beets/default.nix b/user/configs/beets/default.nix index ff8f69d..70ea9de 100755 --- a/user/configs/beets/default.nix +++ b/user/configs/beets/default.nix @@ -1,6 +1,6 @@ { programs.beets = { - enable = true; #until fixed + enable = true; settings = { plugins = "duplicates ftintitle fetchart embedart chroma edit replaygain badfiles fish"; diff --git a/user/configs/kitty/default.nix b/user/configs/kitty/default.nix new file mode 100755 index 0000000..2789958 --- /dev/null +++ b/user/configs/kitty/default.nix @@ -0,0 +1,25 @@ +{ + config, + pkgs, + inputs, + ... +}: { + programs.kitty = { + enable = true; + font = { + name = "JetBrainsMono Nerd Font"; + size = 10; + }; + + shellIntegration.enableFishIntegration = true; + theme = "Gruvbox Dark"; + + settings = { + background_opacity = "0.9"; + modify_font = "cell_height 2px"; + shell_integration = "no-cursor"; + tab_bar_style = "powerline"; + window_padding_width = "14"; + }; + }; +} diff --git a/user/configs/mpd/default.nix b/user/configs/mpd/default.nix index 8d00cb3..1e5c98f 100755 --- a/user/configs/mpd/default.nix +++ b/user/configs/mpd/default.nix @@ -1,5 +1,5 @@ { - imports = [ + imports = [ ../../modules/mpd-notification ]; @@ -96,8 +96,8 @@ # }; services.mpd-mpris = { - enable = true; - mpd.useLocal = true; + enable = true; + mpd.useLocal = true; }; services.mpd-notification = { diff --git a/user/configs/rofi/default.nix b/user/configs/rofi/default.nix index ccf1a74..747a801 100755 --- a/user/configs/rofi/default.nix +++ b/user/configs/rofi/default.nix @@ -2,7 +2,7 @@ programs.rofi = { enable = true; package = pkgs.rofi-wayland; - terminal = "${pkgs.foot}/bin/foot"; + terminal = "${pkgs.kitty}/bin/kitty"; extraConfig = { modi = "drun,run"; }; diff --git a/user/configs/wayland/ags/ags-config/config.js b/user/configs/wayland/ags/ags-config/config.js index ac87b49..945be62 100644 --- a/user/configs/wayland/ags/ags-config/config.js +++ b/user/configs/wayland/ags/ags-config/config.js @@ -1,17 +1,13 @@ import App from 'resource:///com/github/Aylur/ags/app.js' import { exec } from 'resource://com/github/Aylur/ags/utils.js' -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; import Panel from './js/panel/panel.js'; -import NotificationsPopupWindow from './js/notifications/notificationPopup.js'; -import { NotificationCenter } from './js/notifications/notificationCenter.js'; import { forMonitors } from './js/utils.js'; -Notifications.clear(); const styleScss = App.configDir + '/style.scss'; const styleCss = '/tmp/style-ags.css'; @@ -21,7 +17,5 @@ export default { style: styleCss, windows: [ forMonitors(Panel), - NotificationsPopupWindow(), - NotificationCenter(), ].flat(2), }; diff --git a/user/configs/wayland/ags/ags-config/js/notifications/notification.js b/user/configs/wayland/ags/ags-config/js/notifications/notification.js deleted file mode 100644 index 13ee49f..0000000 --- a/user/configs/wayland/ags/ags-config/js/notifications/notification.js +++ /dev/null @@ -1,121 +0,0 @@ -import Widget from 'resource:///com/github/Aylur/ags/widget.js'; -import { lookUpIcon, timeout } from 'resource:///com/github/Aylur/ags/utils.js'; - -const NotificationIcon = ({ appEntry, appIcon, image }) => { - if (image) { - return Widget.Box({ - vpack: 'start', - hexpand: false, - className: 'icon img', - css: ` - background-image: url("${image}"); - background-size: contain; - background-repeat: no-repeat; - background-position: center; - min-width: 78px; - min-height: 78px; - `, - }); - } - - let icon = 'dialog-information-symbolic'; - - if(lookUpIcon(appIcon)) - icon = appIcon; - - if (lookUpIcon(appEntry)) - icon = appEntry; - - return Widget.Box({ - vpack: 'start', - hexpand: false, - className: 'icon', - css: ` - min-width: 78px; - min-height: 78px; - `, - children: [Widget.Icon({ - icon, size: 58, - hpack: 'center', hexpand: true, - vpack: 'center', vexpand: true, - })], - }); -}; - -export const Notification = n => Widget.EventBox({ - className: `notification ${n.urgency}`, - onPrimaryClick: () => n.dismiss(), - properties: [['hovered', false]], - onHover: self => { - if (self._hovered) - return; - - // if there are action buttons and they are hovered - // EventBox onHoverLost will fire off immediately, - // so to prevent this we delay it - timeout(300, () => self._hovered = true); - }, - onHoverLost: self => { - if (!self._hovered) - return; - - self._hovered = false; - n.dismiss(); - }, - vexpand: false, - child: Widget.Box({ - vertical: true, - children: [ - Widget.Box({ - children: [ - NotificationIcon(n), - Widget.Box({ - hexpand: true, - vertical: true, - children: [ - Widget.Box({ - children: [ - Widget.Label({ - className: 'title', - xalign: 0, - justification: 'left', - hexpand: true, - maxWidthChars: 24, - truncate: 'end', - wrap: true, - label: n.summary, - useMarkup: true, - }), - Widget.Button({ - className: 'close-button', - vpack: 'start', - child: Widget.Icon('window-close-symbolic'), - onClicked: n.close.bind(n), - }), - ], - }), - Widget.Label({ - className: 'description', - hexpand: true, - useMarkup: true, - xalign: 0, - justification: 'left', - label: n.body, - wrap: true, - }), - ], - }), - ], - }), - Widget.Box({ - className: 'actions', - children: n.actions.map(({ id, label }) => Widget.Button({ - className: 'action-button', - onClicked: () => n.invoke(id), - hexpand: true, - child: Widget.Label(label), - })), - }), - ], - }), -}); diff --git a/user/configs/wayland/ags/ags-config/js/notifications/notificationCenter.js b/user/configs/wayland/ags/ags-config/js/notifications/notificationCenter.js deleted file mode 100644 index fbf1983..0000000 --- a/user/configs/wayland/ags/ags-config/js/notifications/notificationCenter.js +++ /dev/null @@ -1,39 +0,0 @@ -import { - NotificationList, ClearButton -} from './widgets.js'; -import Widget from 'resource:///com/github/Aylur/ags/widget.js'; -import App from 'resource:///com/github/Aylur/ags/app.js'; - -const Header = () => Widget.Box({ - className: 'header', - children: [ - Widget.Box({ hexpand: true }), - ClearButton(), - ], -}); - -export const NotificationCenter = () => Widget.Window({ - name: 'notification-center', - anchor: [ 'right', 'top', 'bottom'], - popup: true, - visible: false, - focusable: true, - child: Widget.Box({ - children: [ - Widget.EventBox({ - hexpand: true, - connections: [['button-press-event', () => - App.closeWindow('notification-center')]] - }), - Widget.Box({ - vertical: true, - children: [ - Header(), - NotificationList(), - ], - }), - ], - }), -}); - - diff --git a/user/configs/wayland/ags/ags-config/js/notifications/notificationPopup.js b/user/configs/wayland/ags/ags-config/js/notifications/notificationPopup.js deleted file mode 100644 index 0258bc2..0000000 --- a/user/configs/wayland/ags/ags-config/js/notifications/notificationPopup.js +++ /dev/null @@ -1,18 +0,0 @@ -import { Box, Window } from 'resource:///com/github/Aylur/ags/widget.js'; -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; - -import { Notification } from './notification.js'; - -const PopupList = () => Box({ - className: 'notificationPopupList', - css: 'padding: 1px;', // so it shows up - vertical: true, - binds: [['children', Notifications, 'popups', - popups => popups.map(Notification)]], -}); - -export default () => Window({ - name: 'notificationPopupWindow', - anchor: ['right', 'top'], - child: PopupList(), -}); diff --git a/user/configs/wayland/ags/ags-config/js/notifications/widgets.js b/user/configs/wayland/ags/ags-config/js/notifications/widgets.js deleted file mode 100644 index 7d1fbf2..0000000 --- a/user/configs/wayland/ags/ags-config/js/notifications/widgets.js +++ /dev/null @@ -1,60 +0,0 @@ -import { Notification } from './notification.js'; -import Notifications from 'resource:///com/github/Aylur/ags/service/notifications.js'; -import Widget from 'resource:///com/github/Aylur/ags/widget.js'; - -const List = () => Widget.Box({ - vertical: true, - vexpand: true, - connections: [[Notifications, self => { - self.children = Notifications.notifications - .reverse() - .map(Notification); - - self.visible = Notifications.notifications.length > 0; - }]], -}); - -const Placeholder = () => Widget.Box({ - className: 'placeholder', - vertical: true, - vexpand: true, - vpack: 'center', - children: [ - Widget.Icon('notifications-disabled-symbolic'), - Widget.Label('Your inbox is empty'), - ], - binds: [ - ['visible', Notifications, 'notifications', n => n.length === 0], - ], -}); - -export const NotificationList = () => Widget.Scrollable({ - hscroll: 'never', - vscroll: 'automatic', - child: Widget.Box({ - className: 'list', - vertical: true, - children: [ - List(), - Placeholder(), - ], - }), -}); - -export const ClearButton = () => Widget.Button({ - onClicked: () => Notifications.clear(), - binds: [ - ['sensitive', Notifications, 'notifications', n => n.length > 0], - ], - child: Widget.Box({ - children: [ - Widget.Label('Clear'), - Widget.Icon({ - binds: [ - ['icon', Notifications, 'notifications', n => - `user-trash-${n.length > 0 ? 'full-' : ''}symbolic`], - ], - }), - ], - }), -}); diff --git a/user/configs/wayland/ags/ags-config/js/panel/widgets/volume.js b/user/configs/wayland/ags/ags-config/js/panel/widgets/volume.js index 3b2f546..77357c7 100644 --- a/user/configs/wayland/ags/ags-config/js/panel/widgets/volume.js +++ b/user/configs/wayland/ags/ags-config/js/panel/widgets/volume.js @@ -41,7 +41,7 @@ export default () => Button({ if (!Audio.speaker) return; - label.label = ` ${Math.floor((Audio.speaker.volume * 100) / 10) * 10}%`; // round down to nearest 10 + label.label = ` ${Math.floor((Audio.speaker.volume * 100) / 5) * 5}%`; // round down to nearest 5 }, 'speaker-changed'] ], }), diff --git a/user/configs/wayland/ags/ags-config/js/volume_osd/volosd.js b/user/configs/wayland/ags/ags-config/js/volume_osd/volosd.js deleted file mode 100644 index 5f6262a..0000000 --- a/user/configs/wayland/ags/ags-config/js/volume_osd/volosd.js +++ /dev/null @@ -1,15 +0,0 @@ -const { - Label, - Window -} = ags.Widget; - -export default () => Window({ - name: `volume-osd`, - className: `osd`, - monitor: null, - focusable: false, - anchor: ['center'], - popup: true, - - child: Label('hello world'), -}) \ No newline at end of file diff --git a/user/configs/wayland/ags/ags-config/style.scss b/user/configs/wayland/ags/ags-config/style.scss index 3dbd356..ff91bb6 100644 --- a/user/configs/wayland/ags/ags-config/style.scss +++ b/user/configs/wayland/ags/ags-config/style.scss @@ -8,9 +8,6 @@ @import './scss/panel/widgets/clock.scss'; @import './scss/panel/widgets/sysTray.scss'; -@import './scss/notifications/notificationPopup.scss'; - - * { min-height: unset; } diff --git a/user/configs/wayland/foot/default.nix b/user/configs/wayland/foot/default.nix deleted file mode 100755 index ca53198..0000000 --- a/user/configs/wayland/foot/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - config, - pkgs, - inputs, - ... -}: { - programs.foot = { - enable = true; - settings = { - main = { - font = "JetBrainsMono Nerd Font:pixelsize=14"; - pad = "16x16 center"; - underline-offset = "4px"; - }; - - colors = { - alpha = "0.90"; - - background = "282828"; - foreground = "ebdbb2"; - regular0 = "282828"; - regular1 = "cc241d"; - regular2 = "98971a"; - regular3 = "d79921"; - regular4 = "458588"; - regular5 = "b16286"; - regular6 = "689d6a"; - regular7 = "a89984"; - bright0 = "928374"; - bright1 = "fb4934"; - bright2 = "b8bb26"; - bright3 = "fabd2f"; - bright4 = "83a598"; - bright5 = "d3869b"; - bright6 = "8ec07c"; - bright7 = "ebdbb2"; - }; - }; - }; -} diff --git a/user/configs/wayland/hyprland/default.nix b/user/configs/wayland/hyprland/default.nix index c93067e..eeaa68b 100755 --- a/user/configs/wayland/hyprland/default.nix +++ b/user/configs/wayland/hyprland/default.nix @@ -8,7 +8,6 @@ imports = [ ./settings.nix ../ags - ../foot ../wob ]; diff --git a/user/configs/wayland/hyprland/settings.nix b/user/configs/wayland/hyprland/settings.nix index d421672..547e626 100644 --- a/user/configs/wayland/hyprland/settings.nix +++ b/user/configs/wayland/hyprland/settings.nix @@ -91,7 +91,6 @@ in { exec-once = [ "${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp" - "${pkgs.blueman}/bin/blueman-applet" "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" "${pkgs.ydotool}/bin/ydotoold" ]; @@ -99,7 +98,7 @@ in { exec = [ "${pkgs.xorg.xrandr}/bin/xrandr --output ${rightMonitor.display} --primary" "ags -q; ags" - "pkill swww-daemon && sleep 2 && ${pkgs.swww}/bin/swww-daemon && ${pkgs.swww}/bin/swww img ~/.cache/swww/wallpaper" + "sleep 2; pkill swww-daemon; swww init" #Set cursor "${pkgs.hyprland}/bin/hyprctl setcursor '${config.gtk.cursorTheme.name}' ${builtins.toString config.gtk.cursorTheme.size} &> /dev/null" @@ -135,10 +134,10 @@ in { "${modKey}, Q, exec, ${pkgs.firefox}/bin/firefox" - "${modKey}, Return, exec, ${pkgs.foot}/bin/foot" + "${modKey}, Return, exec, ${pkgs.kitty}/bin/kitty" - ", XF86AudioRaiseVolume, exec, ${pkgs.pamixer}/bin/pamixer -i 10 --get-volume" - ", XF86AudioLowerVolume, exec, ${pkgs.pamixer}/bin/pamixer -d 10 --get-volume" + ", XF86AudioRaiseVolume, exec, ${pkgs.pamixer}/bin/pamixer -i 5 --get-volume" + ", XF86AudioLowerVolume, exec, ${pkgs.pamixer}/bin/pamixer -d 5 --get-volume" "CTRL, grave, exec, ags toggle-window notification-center" diff --git a/user/home.nix b/user/home.nix index 99bb2be..adc25de 100755 --- a/user/home.nix +++ b/user/home.nix @@ -1,6 +1,7 @@ { config, pkgs, + lib, inputs, system, ... @@ -8,17 +9,18 @@ imports = [ ./configs/beets ./configs/cava - ./configs/wayland/hyprland - ./configs/rofi + ./configs/dircolors.nix + ./configs/firefox ./configs/fish + ./configs/kitty + ./configs/kvantum ./configs/mpd ./configs/mpv ./configs/neovim - ./configs/firefox - ./configs/dircolors.nix - ./configs/xdg-mime.nix - ./configs/kvantum + ./configs/rofi ./configs/tmux + ./configs/wayland/hyprland + ./configs/xdg-mime.nix inputs.nix-index-database.hmModules.nix-index ]; @@ -70,8 +72,8 @@ twemoji-color-font vimv vulkan-tools - xdg-utils wqy_zenhei #fix for missing non-ascii fonts in TF2 + xdg-utils ]; home.sessionVariables = { @@ -96,7 +98,7 @@ services.gpg-agent = { enable = true; - pinentryFlavor = "gtk2"; + pinentryFlavor = "qt"; }; services.udiskie.enable = true; @@ -164,7 +166,7 @@ }; }; - services.gnome-keyring.enable = true; + # services.gnome-keyring.enable = true; services.easyeffects = { enable = true; diff --git a/user/modules/mpd-notification/default.nix b/user/modules/mpd-notification/default.nix index 32a1bc0..6fe9ac5 100644 --- a/user/modules/mpd-notification/default.nix +++ b/user/modules/mpd-notification/default.nix @@ -1,29 +1,32 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.services.mpd-notification; +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.services.mpd-notification; in { - meta.maintainers = [ "Varris" ]; + meta.maintainers = ["Varris"]; - options.services.mpd-notification = { - package = lib.mkPackageOption pkgs "mpd-notification" { }; - enable = lib.mkEnableOption "the mpd-notification service"; - }; - - config = lib.mkIf cfg.enable { - systemd.user.services.mpd-notification = { - Unit = { - Description = "A notification daemon for MPD"; - Documentation = "https://github.com/eworm-de/mpd-notification"; - After = [ "mpd.service" "network.target" "network-online.target" ]; - Requires = [ "dbus.socket" ]; - }; - - Service = { - Type = "simple"; - Restart = "on-failure"; - ExecStart = "${cfg.package}/bin/mpd-notification"; - }; - }; + options.services.mpd-notification = { + package = lib.mkPackageOption pkgs "mpd-notification" {}; + enable = lib.mkEnableOption "the mpd-notification service"; + }; + + config = lib.mkIf cfg.enable { + systemd.user.services.mpd-notification = { + Unit = { + Description = "A notification daemon for MPD"; + Documentation = "https://github.com/eworm-de/mpd-notification"; + After = ["mpd.service" "network.target" "network-online.target"]; + Requires = ["dbus.socket"]; + }; + + Service = { + Type = "simple"; + Restart = "on-failure"; + ExecStart = "${cfg.package}/bin/mpd-notification"; + }; }; + }; }