feat: add waybar as custom module

This commit is contained in:
Swarsel 2024-07-24 19:49:18 +02:00
parent 821d5cb78e
commit 956c260268
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
5 changed files with 93 additions and 66 deletions

View file

@ -4470,6 +4470,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
monitors = import ./monitors.nix;
input = import ./input.nix;
nixos = import ./nixos.nix;
waybar = import ./waybar.nix;
}
#+end_src
@ -4493,16 +4494,25 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a
***** Hardware
#+begin_src nix :tangle modules/home/hardware.nix
{ lib, ... }:
{
options.swarselsystems.cpuCount = lib.mkOption {
type = lib.types.int;
default = 8;
};
}
#+end_src
***** Waybar
#+begin_src nix :tangle modules/home/waybar.nix
{ lib, config, ... }:
let
generateIcons = n: lib.concatStringsSep " " (builtins.map (x: "{icon" + toString x + "}") (lib.range 0 (n - 1)));
in
{
options.swarselsystems.cpuCount = lib.mkOption {
type = lib.types.int;
default = 8;
};
options.swarselsystems.cpuString = lib.mkOption {
type = lib.types.str;
default = generateIcons config.swarselsystems.cpuCount;