Skip to content

Commit

Permalink
feat(home-manager): add support for swaync
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichthagel committed May 7, 2024
1 parent b0dc7f3 commit b5e0b86
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 1 deletion.
60 changes: 60 additions & 0 deletions _sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
32 changes: 32 additions & 0 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
38 changes: 38 additions & 0 deletions modules/home-manager/swaync.nix
Original file line number Diff line number Diff line change
@@ -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" ]; })
];
};
}
16 changes: 16 additions & 0 deletions nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in
testers.runNixOSTest {
name = "module-test";

nodes.machine = { lib, ... }: {
nodes.machine = { lib, pkgs, ... }: {
imports = [
home-manager.nixosModules.default
./modules/nixos
Expand Down Expand Up @@ -44,6 +44,8 @@ testers.runNixOSTest {
home = {
username = "test";
stateVersion = lib.mkDefault "23.11";

packages = [ pkgs.swaynotificationcenter ];
};

manual.manpages.enable = lib.mkDefault false;
Expand Down

0 comments on commit b5e0b86

Please sign in to comment.