mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
discocss: add module
Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
This commit is contained in:
parent
5597b3a742
commit
2d8e5a9934
4 changed files with 59 additions and 0 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -93,6 +93,8 @@ Makefile @thiagokokada
|
||||||
|
|
||||||
/modules/programs/direnv.nix @rycee
|
/modules/programs/direnv.nix @rycee
|
||||||
|
|
||||||
|
/modules/programs/discocss.nix @Kranzes
|
||||||
|
|
||||||
/modules/programs/eclipse.nix @rycee
|
/modules/programs/eclipse.nix @rycee
|
||||||
|
|
||||||
/modules/programs/emacs.nix @rycee
|
/modules/programs/emacs.nix @rycee
|
||||||
|
|
|
@ -741,6 +741,13 @@ in
|
||||||
A new module is available: 'programs.havoc'.
|
A new module is available: 'programs.havoc'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2022-10-12T23:10:48+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'programs.discocss'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ let
|
||||||
./programs/command-not-found/command-not-found.nix
|
./programs/command-not-found/command-not-found.nix
|
||||||
./programs/dircolors.nix
|
./programs/dircolors.nix
|
||||||
./programs/direnv.nix
|
./programs/direnv.nix
|
||||||
|
./programs/discocss.nix
|
||||||
./programs/eclipse.nix
|
./programs/eclipse.nix
|
||||||
./programs/emacs.nix
|
./programs/emacs.nix
|
||||||
./programs/eww.nix
|
./programs/eww.nix
|
||||||
|
|
49
modules/programs/discocss.nix
Normal file
49
modules/programs/discocss.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let cfg = config.programs.discocss;
|
||||||
|
in {
|
||||||
|
meta.maintainers = with maintainers; [ kranzes ];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
programs.discocss = {
|
||||||
|
enable = mkEnableOption
|
||||||
|
"discocss, a tiny Discord CSS injector for Linux and MacOS";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "discocss" { };
|
||||||
|
|
||||||
|
discordPackage = mkPackageOption pkgs "discord" { };
|
||||||
|
|
||||||
|
discordAlias = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to alias discocss to discord.";
|
||||||
|
};
|
||||||
|
|
||||||
|
css = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "The custom CSS for discocss to use.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [{
|
||||||
|
assertion = cfg.discordAlias
|
||||||
|
-> !(any (p: p.name == cfg.discord.name) config.home.packages);
|
||||||
|
message =
|
||||||
|
"To use discocss with discordAlias you have to remove discord from home.packages, or set discordAlias to false.";
|
||||||
|
}];
|
||||||
|
|
||||||
|
home.packages = [
|
||||||
|
(cfg.package.override {
|
||||||
|
discordAlias = cfg.discordAlias;
|
||||||
|
discord = cfg.discordPackage;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.configFile."discocss/custom.css".text = cfg.css;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue