Skip to content

Commit dbec91d

Browse files
authored
garnix ci/cd (#1)
1 parent 11084f3 commit dbec91d

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# hypr-binds
22

3+
[![ci-badge](https://img.shields.io/static/v1?label=Built%20with&message=nix&color=blue&style=flat&logo=nixos&link=https://nixos.org&labelColor=111212)](https://gvolpe.com)
4+
[![built with garnix](https://img.shields.io/endpoint?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fgvolpe%2Fnix-config%3Fbranch%3Dmaster)](https://garnix.io)
5+
36
Keybinds helper for Hyprland.
47

58
![binds](./imgs/hypr-binds.png)

flake.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@
1111
(system:
1212
let
1313
pkgs = nixpkgs.legacyPackages.${system};
14-
hypr-binds = (pkgs.callPackage ./nix/binds.nix { }) { };
14+
buildPkg = pkgs.callPackage ./nix/binds.nix { };
15+
16+
hypr-binds-wofi = buildPkg { };
17+
hypr-binds-rofi = buildPkg { launcher = "rofi"; };
1518
in
1619
{
1720
homeManagerModules.default = {
1821
imports = [ ./nix/hm.nix ];
1922
};
2023

2124
packages = {
22-
default = hypr-binds;
23-
inherit hypr-binds;
25+
default = hypr-binds-wofi;
26+
inherit hypr-binds-wofi hypr-binds-rofi;
2427
};
2528
}
2629
);

garnix.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
builds:
2+
exclude: []
3+
include:
4+
- '*.x86_64-linux.*'
5+
- '*.aarch64-linux.*'

nix/binds.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{ lib, jq, wofi, writeShellScriptBin }:
1+
{ lib, jq, pkgs, writeShellScriptBin }:
22

3-
{ launcher ? "${lib.getExe wofi} --dmenu -m -i -p 'Hypr binds'"
3+
{ launcher ? "wofi"
44
, cmdcolor ? "cyan"
55
, modkeyStyle ? "<b>$MOD$KEY</b> <i>$DESCRIPTION</i>"
66
, dispatch ? true
@@ -21,6 +21,12 @@ let
2121
"59" = "Comma";
2222
"60" = "Dot";
2323
};
24+
25+
launcherCommand =
26+
if launcher == "rofi"
27+
then "${lib.getExe pkgs.rofi} -dmenu -markup-rows -i -p 'Hypr binds'"
28+
else "${lib.getExe pkgs.wofi} --dmenu -m -i -p 'Hypr binds'";
29+
2430
style =
2531
let
2632
modkey = builtins.replaceStrings
@@ -38,7 +44,7 @@ writeShellScriptBin "hypr-binds" ''
3844
map(.code |= ${builtins.toJSON keycodes} [.]) |
3945
sort_by(.mod) | .[] |
4046
select(.sub == "") |
41-
"${style}" ' | ${launcher} |
47+
"${style}" ' | ${launcherCommand} |
4248
# extract the command (dispatcher + arg)
4349
sed -n 's/.*<span color=\"${cmdcolor}\">\(.*\)<\/span>.*/\1/p' |
4450
${if dispatch then ''

nix/hm.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ in
1414
settings = {
1515
launcher = {
1616
app = mkOption {
17-
type = types.str;
18-
description = "The launcher application (defaults to wofi, but others like rofi can be used)";
19-
default = "${lib.getExe pkgs.wofi} --dmenu -m -i -p 'Hypr binds'";
17+
type = types.enum [ "rofi" "wofi" ];
18+
description = "The launcher application";
19+
default = "wofi";
2020
};
2121

2222
style = {

0 commit comments

Comments
 (0)