diff --git a/home/isabel/configs/gui/swaync.nix b/home/isabel/configs/gui/swaync.nix index db171f786..bffb444a2 100644 --- a/home/isabel/configs/gui/swaync.nix +++ b/home/isabel/configs/gui/swaync.nix @@ -1,17 +1,13 @@ { lib, pkgs, - self, osConfig, ... }: let inherit (lib) mkIf; in { - imports = [self.homeManagerModules.swaync]; - services.swaync = mkIf osConfig.modules.programs.gui.bars.waybar.enable { enable = true; - systemd.enable = true; style = pkgs.fetchurl { url = "https://github.com/catppuccin/swaync/releases/download/v0.2.2/mocha.css"; diff --git a/modules/base/nix/nix.nix b/modules/base/nix/nix.nix index 59ba0d555..7fe9066f0 100644 --- a/modules/base/nix/nix.nix +++ b/modules/base/nix/nix.nix @@ -11,8 +11,8 @@ in { nix = { # https://github.com/nix-community/home-manager/issues/4692#issuecomment-1848832609 - package = pkgs.nixVersions.unstable; - # package = pkgs.nixVersions.nix_2_22; + # package = pkgs.nixVersions.unstable; + package = pkgs.nixVersions.nix_2_22; # pin the registry to avoid downloading and evaluating a new nixpkgs version everytime registry = mapAttrs (_: v: {flake = v;}) flakeInputs; diff --git a/modules/extra/home-manager/default.nix b/modules/extra/home-manager/default.nix index 26b2188cc..4726bfad9 100644 --- a/modules/extra/home-manager/default.nix +++ b/modules/extra/home-manager/default.nix @@ -2,7 +2,5 @@ imports = [ ./gtklock.nix ./hyfetch.nix - ./nushell.nix - ./swaync.nix ]; } diff --git a/modules/extra/home-manager/swaync.nix b/modules/extra/home-manager/swaync.nix deleted file mode 100644 index 223c15775..000000000 --- a/modules/extra/home-manager/swaync.nix +++ /dev/null @@ -1,145 +0,0 @@ -# modfied from https://github.com/rxyhn/yuki/blob/ebaefa6e0ba4f9dc5a337684fd9b41e3282ed334/modules/flake/home-manager/swaync/default.nix -{ - lib, - pkgs, - config, - ... -}: let - cfg = config.services.swaync; - settingsFormat = pkgs.formats.json {}; - - settings = cfg.settings // {"$schema" = cfg.schema;}; - configFile = (settingsFormat.generate "swaync/config.json" settings).overrideAttrs (_: { - checkPhase = "${pkgs.check-jsonschema}/bin/check-jsonschema --schemafile ${settings."$schema"} $out "; - }); -in { - meta.maintainers = [lib.maintainers.isabelroses]; - - options.services.swaync = { - enable = lib.mkEnableOption "Swaync notification daemon"; - - package = lib.mkPackageOption pkgs "swaynotificationcenter" {}; - - systemd = { - enable = lib.mkEnableOption "Systemd integration"; - - target = lib.mkOption { - type = lib.types.str; - default = "graphical-session.target"; - example = "sway-session.target"; - description = '' - Systemd target to bind to. - ''; - }; - }; - - style = lib.mkOption { - type = lib.types.nullOr (lib.types.either lib.types.path lib.types.lines); - default = null; - description = '' - CSS style of the bar. See https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/style.css for - the documentation. - - If the value is set to a path literal, then the path will be used as the CSS file. - ''; - example = '' - .notification-row { - outline: none; - } - - .notification-row:focus, - .notification-row:hover { - background: @noti-bg-focus; - } - - .notification { - border-radius: 12px; - margin: 6px 12px; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), - 0 2px 6px 2px rgba(0, 0, 0, 0.3); - padding: 0; - } - ''; - }; - - schema = lib.mkOption { - default = "${cfg.package}/etc/xdg/swaync/configSchema.json"; - type = lib.types.path; - description = lib.mdDoc '' - Schema to validate the configuration. - ''; - }; - - settings = lib.mkOption { - default = {}; - type = settingsFormat.type; - description = '' - Configuration written to {file}`$XDG_CONFIG_HOME/swaync/config.json`. - See https://github.com/ErikReider/SwayNotificationCenter/blob/main/src/configSchema.json for the documentation. - ''; - example = lib.literalExpression '' - { - positionX = "right"; - positionY = "top"; - layer = "overlay"; - control-center-layer = "top"; - layer-shell = true; - cssPriority = "application"; - control-center-margin-top = 0; - control-center-margin-bottom = 0; - control-center-margin-right = 0; - control-center-margin-left = 0; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 64; - notification-body-image-height = 100; - notification-body-image-width = 200 - }; - ''; - }; - }; - - config = lib.mkIf cfg.enable { - # at-spi2-core is to minimize journalctl noise of: - # "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files" - home.packages = [cfg.package pkgs.at-spi2-core]; - - xdg.configFile = { - "swaync/config.json".source = configFile; - "swaync/style.css" = lib.mkIf (cfg.style != null) { - source = - if builtins.isPath cfg.style || lib.isStorePath cfg.style - then cfg.style - else pkgs.writeText "swaync/style.css" cfg.style; - }; - }; - - systemd.user.services.swaync = lib.mkIf cfg.systemd.enable { - Unit = { - Description = "Swaync notification daemon"; - Documentation = "https://github.com/ErikReider/SwayNotificationCenter"; - PartOf = ["graphical-session.target"]; - After = ["graphical-session-pre.target"]; - ConditionEnvironment = "WAYLAND_DISPLAY"; - - X-Restart-Triggers = - ["${config.xdg.configFile."swaync/config.json".source}"] - ++ lib.optional (cfg.style != null) - "${config.xdg.configFile."swaync/style.css".source}"; - }; - - Service = { - Type = "dbus"; - BusName = "org.freedesktop.Notifications"; - ExecStart = "${cfg.package}/bin/swaync"; - ExecReload = - ["${cfg.package}/bin/swaync-client --reload-config"] - ++ lib.optional (cfg.style != null) - "${cfg.package}/bin/swaync-client --reload-css"; - Restart = "on-failure"; - }; - - Install.WantedBy = [cfg.systemd.target]; - }; - }; -} diff --git a/parts/modules/default.nix b/parts/modules/default.nix index 7a27b19ef..e069d829b 100644 --- a/parts/modules/default.nix +++ b/parts/modules/default.nix @@ -22,8 +22,6 @@ in { hyfetch = mkModule /modules/extra/home-manager/hyfetch.nix; - swaync = mkModule /modules/extra/home-manager/swaync.nix; - default = builtins.throw "There is no default module."; }; };