mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-24 20:22:10 +00:00
3b6bafe91a
Add a home-manager module to simplify installation and config management on nix systems. This greatly reduces the setup time and makes it integrate better with other programs on nix, mainly Hyprland which this module is based on.
54 lines
1.4 KiB
Nix
54 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;
|
|
};
|
|
};
|
|
}
|