onagre: add module (#6958)
This commit is contained in:
parent
1e8c62c651
commit
123297c57e
6 changed files with 250 additions and 0 deletions
|
|
@ -211,6 +211,7 @@ let
|
|||
./programs/octant.nix
|
||||
./programs/offlineimap.nix
|
||||
./programs/oh-my-posh.nix
|
||||
./programs/onagre.nix
|
||||
./programs/onedrive.nix
|
||||
./programs/onlyoffice.nix
|
||||
./programs/opam.nix
|
||||
|
|
|
|||
74
modules/programs/onagre.nix
Normal file
74
modules/programs/onagre.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
types
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.onagre;
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
|
||||
options.programs.onagre = {
|
||||
enable = mkEnableOption "onagre";
|
||||
package = mkPackageOption pkgs "onagre" { nullable = true; };
|
||||
style = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
.onagre {
|
||||
--exit-unfocused: false;
|
||||
height: 250px;
|
||||
width: 400px;
|
||||
--font-family: "Iosevka,Iosevka Nerd Font";
|
||||
font-size: 18px;
|
||||
background: #151515;
|
||||
color: #414141;
|
||||
padding: 10px;
|
||||
|
||||
.container {
|
||||
.rows {
|
||||
--height: fill-portion 6;
|
||||
.row-selected {
|
||||
color: #ffffff;
|
||||
--spacing: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
background: #151515;
|
||||
width: 0;
|
||||
.scroller {
|
||||
width: 0;
|
||||
color: #151515;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration file to be written to theme.scss for setting
|
||||
Onagre's theme. The documentation can be found here:
|
||||
<https://github.com/onagre-launcher/onagre/wiki/Theming>
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.onagre" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
xdg.configFile."onagre/theme.scss" = mkIf (cfg.style != "") { text = cfg.style; };
|
||||
};
|
||||
}
|
||||
|
|
@ -385,6 +385,7 @@ import nmtSrc {
|
|||
./modules/programs/mpvpaper
|
||||
./modules/programs/ncmpcpp-linux
|
||||
./modules/programs/nh
|
||||
./modules/programs/onagre
|
||||
./modules/programs/onedrive
|
||||
./modules/programs/pqiv
|
||||
./modules/programs/rbw
|
||||
|
|
|
|||
1
tests/modules/programs/onagre/default.nix
Normal file
1
tests/modules/programs/onagre/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ onagre-example-config = ./example-config.nix; }
|
||||
93
tests/modules/programs/onagre/example-config.nix
Normal file
93
tests/modules/programs/onagre/example-config.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
programs.onagre = {
|
||||
enable = true;
|
||||
style = ''
|
||||
.onagre {
|
||||
background: #d6d6d6;
|
||||
color: #000000;
|
||||
--icon-theme: "Papirus";
|
||||
--font-family: "DejaVuSans";
|
||||
--icon-size: 24;
|
||||
border-radius: 8%;
|
||||
border-color: #d6d6d6;
|
||||
border-width: 4px;
|
||||
padding: 5px;
|
||||
|
||||
.container {
|
||||
.rows {
|
||||
--height: fill-portion 6;
|
||||
.row {
|
||||
--width: 392;
|
||||
|
||||
.icon {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
padding-left: 5px;
|
||||
--icon-size: 11;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.row-selected {
|
||||
--width: 392;
|
||||
border-radius: 8%;
|
||||
background: #c0c0c0;
|
||||
|
||||
.icon {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
padding-left: 5px;
|
||||
--icon-size: 11;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
border-radius: 5%;
|
||||
background: #ffffff;
|
||||
--height: fill-portion 1;
|
||||
padding: 4px;
|
||||
.input {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
width: 2px;
|
||||
border-radius: 5%;
|
||||
background: #c0c0c0;
|
||||
.scroller {
|
||||
width: 4px;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/onagre/theme.scss
|
||||
assertFileContent home-files/.config/onagre/theme.scss \
|
||||
${./style}
|
||||
'';
|
||||
}
|
||||
80
tests/modules/programs/onagre/style
Normal file
80
tests/modules/programs/onagre/style
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
.onagre {
|
||||
background: #d6d6d6;
|
||||
color: #000000;
|
||||
--icon-theme: "Papirus";
|
||||
--font-family: "DejaVuSans";
|
||||
--icon-size: 24;
|
||||
border-radius: 8%;
|
||||
border-color: #d6d6d6;
|
||||
border-width: 4px;
|
||||
padding: 5px;
|
||||
|
||||
.container {
|
||||
.rows {
|
||||
--height: fill-portion 6;
|
||||
.row {
|
||||
--width: 392;
|
||||
|
||||
.icon {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
padding-left: 5px;
|
||||
--icon-size: 11;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.row-selected {
|
||||
--width: 392;
|
||||
border-radius: 8%;
|
||||
background: #c0c0c0;
|
||||
|
||||
.icon {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
padding-left: 5px;
|
||||
--icon-size: 11;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.description {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
border-radius: 5%;
|
||||
background: #ffffff;
|
||||
--height: fill-portion 1;
|
||||
padding: 4px;
|
||||
.input {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.scrollable {
|
||||
width: 2px;
|
||||
border-radius: 5%;
|
||||
background: #c0c0c0;
|
||||
.scroller {
|
||||
width: 4px;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue