diff --git a/_sources/generated.json b/_sources/generated.json index 872ae156..15d1553b 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -619,6 +619,66 @@ }, "version": "77246bbbbf8926bdb8962cffab6616bc2b9e8a06" }, + "swaync-frappe": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "swaync-frappe", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-/Y0FqRbun2dFnDHTyUvKYTesjH8f2N1n0ITzGR3PlWU=", + "type": "url", + "url": "https://github.com/catppuccin/swaync/releases/download/v0.2.2/frappe.css" + }, + "version": "v0.2.2" + }, + "swaync-latte": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "swaync-latte", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-701jarDOTKD8BYYiLEdQm4HIcVYFKRSaoJ/IeSytMrA=", + "type": "url", + "url": "https://github.com/catppuccin/swaync/releases/download/v0.2.2/latte.css" + }, + "version": "v0.2.2" + }, + "swaync-macchiato": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "swaync-macchiato", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-EdpYKeeIJrnbjR98QQ4YXsNBsdrm6E2Nr7cmUBpTv6Y=", + "type": "url", + "url": "https://github.com/catppuccin/swaync/releases/download/v0.2.2/macchiato.css" + }, + "version": "v0.2.2" + }, + "swaync-mocha": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "swaync-mocha", + "passthru": null, + "pinned": false, + "src": { + "name": null, + "sha256": "sha256-YFboTWj/hiJhmnMbGLtfcxKxvIpJxUCSVl2DgfpglfE=", + "type": "url", + "url": "https://github.com/catppuccin/swaync/releases/download/v0.2.2/mocha.css" + }, + "version": "v0.2.2" + }, "tmux": { "cargoLocks": null, "date": "2024-04-21", diff --git a/_sources/generated.nix b/_sources/generated.nix index 9b883943..72f1943e 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -373,6 +373,38 @@ }; date = "2024-04-01"; }; + swaync-frappe = { + pname = "swaync-frappe"; + version = "v0.2.2"; + src = fetchurl { + url = "https://github.com/catppuccin/swaync/releases/download/v0.2.2/frappe.css"; + sha256 = "sha256-/Y0FqRbun2dFnDHTyUvKYTesjH8f2N1n0ITzGR3PlWU="; + }; + }; + swaync-latte = { + pname = "swaync-latte"; + version = "v0.2.2"; + src = fetchurl { + url = "https://github.com/catppuccin/swaync/releases/download/v0.2.2/latte.css"; + sha256 = "sha256-701jarDOTKD8BYYiLEdQm4HIcVYFKRSaoJ/IeSytMrA="; + }; + }; + swaync-macchiato = { + pname = "swaync-macchiato"; + version = "v0.2.2"; + src = fetchurl { + url = "https://github.com/catppuccin/swaync/releases/download/v0.2.2/macchiato.css"; + sha256 = "sha256-EdpYKeeIJrnbjR98QQ4YXsNBsdrm6E2Nr7cmUBpTv6Y="; + }; + }; + swaync-mocha = { + pname = "swaync-mocha"; + version = "v0.2.2"; + src = fetchurl { + url = "https://github.com/catppuccin/swaync/releases/download/v0.2.2/mocha.css"; + sha256 = "sha256-YFboTWj/hiJhmnMbGLtfcxKxvIpJxUCSVl2DgfpglfE="; + }; + }; tmux = { pname = "tmux"; version = "a556353d60833367b13739e660d4057a96f2f4fe"; diff --git a/modules/home-manager/swaync.nix b/modules/home-manager/swaync.nix new file mode 100644 index 00000000..69df28fd --- /dev/null +++ b/modules/home-manager/swaync.nix @@ -0,0 +1,38 @@ +{ config +, lib +, pkgs +, sources +, ... +}: +let + cfg = config.services.swaync.catppuccin; + enable = cfg.enable && config.services.swaync.enable; + themeRaw = sources."swaync-${cfg.flavour}"; + theme = pkgs.substitute { + src = themeRaw; + + substitutions = [ + "--replace-warn" + "Ubuntu Nerd Font" + cfg.font + ]; + }; +in +{ + options.services.swaync.catppuccin = lib.ctp.mkCatppuccinOpt "sway" // { + font = lib.mkOption { + type = lib.types.str; + default = "Ubuntu Nerd Font"; + description = "Font to use for the notification center"; + }; + }; + + config = lib.mkIf enable { + services.swaync.style = theme; + + # Install the default font if it is selected + home.packages = lib.mkIf (cfg.font == "Ubuntu Nerd Font") [ + (pkgs.nerdfonts.override { fonts = [ "Ubuntu" ]; }) + ]; + }; +} diff --git a/nvfetcher.toml b/nvfetcher.toml index 8485978d..e81ad95a 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -122,6 +122,22 @@ fetch.github = "catppuccin/sway" src.git = "https://github.com/catppuccin/swaylock.git" fetch.github = "catppuccin/swaylock" +[swaync-latte] +src.github = "catppuccin/swaync" +fetch.url = "https://github.com/catppuccin/swaync/releases/download/$ver/latte.css" + +[swaync-frappe] +src.github = "catppuccin/swaync" +fetch.url = "https://github.com/catppuccin/swaync/releases/download/$ver/frappe.css" + +[swaync-macchiato] +src.github = "catppuccin/swaync" +fetch.url = "https://github.com/catppuccin/swaync/releases/download/$ver/macchiato.css" + +[swaync-mocha] +src.github = "catppuccin/swaync" +fetch.url = "https://github.com/catppuccin/swaync/releases/download/$ver/mocha.css" + [tmux] src.git = "https://github.com/catppuccin/tmux.git" fetch.github = "catppuccin/tmux" diff --git a/test.nix b/test.nix index ab577dbe..e869aa7a 100644 --- a/test.nix +++ b/test.nix @@ -10,7 +10,7 @@ in testers.runNixOSTest { name = "module-test"; - nodes.machine = { lib, ... }: { + nodes.machine = { lib, pkgs, ... }: { imports = [ home-manager.nixosModules.default ./modules/nixos @@ -44,6 +44,8 @@ testers.runNixOSTest { home = { username = "test"; stateVersion = lib.mkDefault "23.11"; + + packages = [ pkgs.swaynotificationcenter ]; }; manual.manpages.enable = lib.mkDefault false;