Blehg
This commit is contained in:
parent
0301f7dc24
commit
8e44992e00
14 changed files with 2480 additions and 0 deletions
62
modules/home/macchina/default.nix
Normal file
62
modules/home/macchina/default.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.programs.macchina;
|
||||
tomlFormat = pkgs.formats.toml {};
|
||||
in {
|
||||
options.programs.macchina = {
|
||||
enable = mkEnableOption "macchina";
|
||||
package = mkPackageOption pkgs "macchina" {};
|
||||
|
||||
config = mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
default = {};
|
||||
|
||||
example = {
|
||||
theme = "Mezora";
|
||||
show = [
|
||||
"Kernel"
|
||||
"Machine"
|
||||
"OperatingSystem"
|
||||
"Resolution"
|
||||
"Uptime"
|
||||
"LocalIP"
|
||||
"Packages"
|
||||
"ProcessorLoad"
|
||||
"Memory"
|
||||
"Battery"
|
||||
];
|
||||
};
|
||||
|
||||
description = ''
|
||||
Macchina configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
themes = with types;
|
||||
mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [cfg.package];
|
||||
xdg.configFile =
|
||||
{
|
||||
"macchina/macchina.toml".source =
|
||||
tomlFormat.generate "macchina.toml" cfg.config;
|
||||
}
|
||||
// (
|
||||
attrsets.concatMapAttrs (name: value: {
|
||||
"macchina/themes/${name}.toml".source =
|
||||
tomlFormat.generate "${name}.toml" value;
|
||||
})
|
||||
cfg.themes
|
||||
);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue