Skip to content

Commit

Permalink
waybar: sops conditional secret
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 24, 2025
1 parent 43d6e6b commit 1f81056
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion modules/home/programs/graphical/bars/waybar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ let
statsStyle = builtins.readFile ./styles/stats.css;
workspacesStyle = builtins.readFile ./styles/workspaces.css;

custom-modules = import ./modules/custom-modules.nix { inherit config lib pkgs; };
custom-modules = import ./modules/custom-modules.nix {
inherit
osConfig
config
lib
namespace
pkgs
;
};
default-modules = import ./modules/default-modules.nix { inherit lib pkgs; };
group-modules = import ./modules/group-modules.nix { inherit lib namespace osConfig; };
hyprland-modules = import ./modules/hyprland-modules.nix { inherit config lib; };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
config,
lib,
osConfig,
pkgs,
namespace,
...
}:
let
inherit (lib) getExe getExe';

githubHelper = pkgs.writeShellScriptBin "githubHelper" ''
${getExe pkgs.gh} auth login --with-token < ${config.sops.secrets."github/access-token".path}
${lib.optionalString osConfig.${namespace}.security.sops.enable ''
${getExe pkgs.gh} auth login --with-token < ${config.sops.secrets."github/access-token".path}
''}
NOTIFICATIONS="$(${getExe pkgs.gh} api notifications)"
COUNT="$(${getExe pkgs.gh} api notifications --jq 'length')"
Expand Down

0 comments on commit 1f81056

Please sign in to comment.