Skip to content

Commit

Permalink
feat(home-manager): init wofi module
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Nov 2, 2023
1 parent 96e861b commit 185ea91
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,25 @@
"type": "github"
},
"version": "47e33044b4b47b1c1faca1e42508fc92be12131a"
},
"wofi": {
"cargoLocks": null,
"date": "2023-09-16",
"extract": null,
"name": "wofi",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "quantumfate",
"repo": "wofi",
"rev": "6c37e0f65b9af45ebe680e3e0f5131f452747c6f",
"sha256": "sha256-zQGiF/8WZ15ZlQVVgxuQq4qatinxMx2Y6Xl5Zcuhp7Y=",
"type": "github"
},
"version": "6c37e0f65b9af45ebe680e3e0f5131f452747c6f"
}
}
12 changes: 12 additions & 0 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,16 @@
};
date = "2023-11-01";
};
wofi = {
pname = "wofi";
version = "6c37e0f65b9af45ebe680e3e0f5131f452747c6f";
src = fetchFromGitHub {
owner = "quantumfate";
repo = "wofi";
rev = "6c37e0f65b9af45ebe680e3e0f5131f452747c6f";
fetchSubmodules = false;
sha256 = "sha256-zQGiF/8WZ15ZlQVVgxuQq4qatinxMx2Y6Xl5Zcuhp7Y=";
};
date = "2023-09-16";
};
}
1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ in
./polybar.nix
./sway.nix
./tmux.nix
./wofi.nix
];
in
extendedLib.ctp.mapModules extendedLib files;
Expand Down
32 changes: 32 additions & 0 deletions modules/home-manager/wofi.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ config
, pkgs
, lib
, sources
, ...
}:
let
inherit (builtins) readFile;

cfg = config.programs.wofi.catppuccin;
enable = cfg.enable && config.programs.wofi.enable;
# The font already hardcoded in the theme
hardcodedFont = "Inconsolata Nerd Font";
in
{
options.programs.wofi.catppuccin =
lib.ctp.mkCatppuccinOpt "wofi"
// {
font = lib.mkOption {
type = lib.types.str;
default = hardcodedFont;
description = "Font to use for wofi";
};
};

config.programs.wofi.style = lib.mkIf enable
(readFile
(pkgs.runCommand "catppuccin-wofi-theme" { } ''
cp ${sources.wofi}/src/${cfg.flavour}/style.css $out
substituteInPlace $out --replace "${hardcodedFont}" "${cfg.font}"
''));
}
4 changes: 4 additions & 0 deletions nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ fetch.github = "catppuccin/sway"
[tmux]
src.git = "https://github.com/catppuccin/tmux.git"
fetch.github = "catppuccin/tmux"

[wofi]
src.git = "https://github.com/quantumfate/wofi.git"
fetch.github = "quantumfate/wofi"

0 comments on commit 185ea91

Please sign in to comment.