mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 19:22:50 +00:00
55 lines
1.4 KiB
Nix
55 lines
1.4 KiB
Nix
|
# Based on Hyprland's home-manager and NixOS module
|
||
|
|
||
|
self:
|
||
|
{ config
|
||
|
, lib
|
||
|
, pkgs
|
||
|
, ...
|
||
|
}: let
|
||
|
cfg = config.programs.gBar;
|
||
|
|
||
|
defaultGBarPackage = self.defaultPackage.x86_64-linux;
|
||
|
|
||
|
in {
|
||
|
options.programs.gBar = {
|
||
|
enable = lib.mkEnableOption "Wether to enable gBar, a blazingly fast statusbar written in c++";
|
||
|
|
||
|
package = lib.mkOption {
|
||
|
type = lib.types.nullOr lib.types.package;
|
||
|
default = defaultGBarPackage;
|
||
|
defaultText = lib.literalExpression "<gBar flake>.packages.<system>.default";
|
||
|
example = lib.literalExpression "<gBar flake>.packages.<system>.default.override { }";
|
||
|
description = ''
|
||
|
gBar package to use.
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
extraConfig = lib.mkOption {
|
||
|
type = lib.types.nullOr lib.types.lines;
|
||
|
default = null;
|
||
|
description = ''
|
||
|
Configuration to write to ~/.config/gBar/config, if none nothing happens
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
extraCSS = lib.mkOption {
|
||
|
type = lib.types.nullOr lib.types.lines;
|
||
|
default = null;
|
||
|
description = ''
|
||
|
Configuration to write to ~/.config/gBar/config, if none nothing happens
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf cfg.enable {
|
||
|
home.packages = lib.optional (cfg.package != null) cfg.package;
|
||
|
|
||
|
xdg.configFile."gBar/config" = lib.mkIf (cfg.extraConfig != null) {
|
||
|
text = cfg.extraConfig;
|
||
|
};
|
||
|
xdg.configFile."gBar/style.css" = lib.mkIf (cfg.extraCSS != null) {
|
||
|
text = cfg.extraCSS;
|
||
|
};
|
||
|
};
|
||
|
}
|