Switch to nix-rice 0.3.1

This commit is contained in:
Filippo Berto 2023-01-01 18:01:38 +01:00
parent 740dceeb6a
commit 412d7cc283
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
15 changed files with 63 additions and 59 deletions

View file

@ -10,7 +10,7 @@
, palette ? rice.palette.palette { }
, ...
}:
let strPalette = lib.rice.palette.toRGBAHex palette;
let strPalette = lib.nix-rice.palette.toRGBAHex palette;
in writeScriptBin "lockscreen" ''
# Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \

7
flake.lock generated
View file

@ -211,15 +211,16 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1672499632,
"narHash": "sha256-zjuPInQda9zTYCNshV/Ii8xOebNdQIcZ6jT7mKjU8js=",
"lastModified": 1672591525,
"narHash": "sha256-1qWXUQkCuz0HwDReFHYfl9nyfFJIDRZawP6+ZlGN8V4=",
"owner": "bertof",
"repo": "nix-rice",
"rev": "23399d25089c6e3bc94b26fc9fd6edc76c1cba08",
"rev": "fd95c11946f07a25cda5b50eab74d25a03e00574",
"type": "github"
},
"original": {
"owner": "bertof",
"ref": "testing",
"repo": "nix-rice",
"type": "github"
}

View file

@ -11,7 +11,7 @@
flake-utils.url = "github:numtide/flake-utils";
nixos-generators = { url = "github:nix-community/nixos-generators"; inputs = { nixpkgs.follows = "nixpkgs"; }; };
nixos-hardware.url = "github:NixOS/nixos-hardware";
nix-rice = { url = "github:bertof/nix-rice"; };
nix-rice = { url = "github:bertof/nix-rice/testing"; };
pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; };
tex2nix = { url = "github:Mic92/tex2nix"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; };
};

View file

@ -1,7 +1,7 @@
{ pkgs, ... }:
let
strPalette = with pkgs.rice;
pkgs.lib.rice.palette.toRgbHex rec {
pkgs.lib.nix-rice.palette.toRgbHex rec {
inherit (colorPalette) normal bright primary;
dim = colorPalette.dark;

View file

@ -1,5 +1,5 @@
{ pkgs, lib, ... }:
with pkgs.lib.nix-rice;
let
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
monitorPages = [ "" "" "" "" "" "" "" "" "" "" ];
@ -10,7 +10,7 @@ let
bspc monitor $monitor -d ${monitorPagesString}
done
'';
strPalette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
strPalette = palette.toRGBHex pkgs.rice.colorPalette;
in
{
xsession.windowManager.bspwm = {

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ... }:
let
strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex colorPalette;
strPalette = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.colorPalette;
fmtString = str: "'${str}'";
in
{

View file

@ -1,5 +1,6 @@
{ pkgs, ... }:
let palette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
with pkgs.lib.nix-rice;
let strPalette = palette.toRGBHex pkgs.rice.colorPalette;
in
{
home.packages = with pkgs; [ dunst rice.font.normal.package ];
@ -22,8 +23,8 @@ in
padding = 8;
horizontal_padding = 8;
frame_width = 2;
frame_color = palette.normal.black;
separator_color = palette.normal.blue;
frame_color = strPalette.normal.black;
separator_color = strPalette.normal.blue;
sort = "yes";
idle_threshold = 120;
@ -58,19 +59,19 @@ in
mouse_right_click = "close_all";
};
urgency_low = {
background = palette.normal.black;
foreground = palette.normal.white;
background = strPalette.normal.black;
foreground = strPalette.normal.white;
timeout = 10;
};
urgency_normal = {
background = palette.normal.black;
foreground = palette.normal.white;
background = strPalette.normal.black;
foreground = strPalette.normal.white;
timeout = 10;
};
urgency_critical = {
background = palette.normal.black;
foreground = palette.normal.white;
frame_color = palette.bright.red;
background = strPalette.normal.black;
foreground = strPalette.normal.white;
frame_color = strPalette.bright.red;
timeout = 0;
};
shortcuts = {

View file

@ -276,7 +276,7 @@ in
# THEME FILE
xdg.configFile."kak/colors/nord.kak".text =
themeBuilder (pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette);
themeBuilder (pkgs.lib.nix-rice.palette.toRgbShortHex pkgs.rice.colorPalette);
xdg.configFile."kak-lsp/kak-lsp.toml".text = ''
snippet_support = false

View file

@ -1,7 +1,7 @@
{ pkgs, ... }:
let
strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex {
inherit (colorPalette)
strPalette = pkgs.lib.nix-rice.palette.toRgbHex {
inherit (pkgs.rice.colorPalette)
background
foreground
color0

View file

@ -1,5 +1,6 @@
{ pkgs, ... }:
let strPalette = pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette;
with pkgs.lib.nix-rice;
let strPalette = palette.toRgbShortHex pkgs.rice.colorPalette;
in {
programs.mangohud = {
enable = true;

View file

@ -27,7 +27,7 @@ let
session=`${loginctl} session-status | ${pkgs.coreutils}/bin/head -n 1 | ${pkgs.gawk}/bin/awk '{print $1}'`
${loginctl} terminate-session $session
'';
colors = with pkgs.lib.rice;
colors = with pkgs.lib.nix-rice;
let alpha = 255 * opacity;
in
palette.toARGBHex rec {

View file

@ -1,32 +1,31 @@
{ pkgs, ... }:
with pkgs.lib.nix-rice;
let
strPalette = pkgs.lib.rice.palette.toRgbHex rec {
strPalette = palette.toRgbHex {
inherit (pkgs.rice.colorPalette) normal bright dark;
background = normal.black;
foreground = normal.white;
inherit (pkgs.rice.colorPalette.primary) background foreground;
};
opacity = toString pkgs.rice.opacity;
font = pkgs.rice.font.monospace;
colorString = with strPalette;
normal: bright:
builtins.concatStringsSep ":" [
normal.black
normal.red
normal.green
normal.yellow
normal.blue
normal.magenta
normal.cyan
normal.white
bright.black
bright.red
bright.green
bright.yellow
bright.blue
bright.magenta
bright.cyan
bright.white
];
colorString = normal: bright:
builtins.concatStringsSep ":" [
normal.black
normal.red
normal.green
normal.yellow
normal.blue
normal.magenta
normal.cyan
normal.white
bright.black
bright.red
bright.green
bright.yellow
bright.blue
bright.magenta
bright.cyan
bright.white
];
in
{
home.packages = with pkgs; [ terminator ];

View file

@ -1,20 +1,21 @@
{ pkgs, ... }:
with pkgs.lib.nix-rice;
let
palette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
strPalette = palette.toRGBHex pkgs.rice.colorPalette;
font = pkgs.rice.font.normal;
in
{
services.twmn = {
enable = true;
text = {
color = palette.primary.foreground;
color = strPalette.primary.foreground;
font = { inherit (font) package size; family = font.name; };
};
window = {
animation.bounce.enable = false;
color = palette.primary.background;
color = strPalette.primary.background;
height = 32;
opacity = pkgs.lib.rice.float.round (pkgs.rice.opacity * 100);
opacity = float.round (pkgs.rice.opacity * 100);
offset = { x = -20; y = 50; };
};
};

View file

@ -1,5 +1,6 @@
{ pkgs, ... }:
let strPalette = pkgs.lib.rice.palette.toRgbHex pkgs.rice.colorPalette;
with pkgs.lib.nix-rice;
let strPalette = palette.toRgbHex pkgs.rice.colorPalette;
in {
programs.zathura = {
enable = true;

View file

@ -1,17 +1,17 @@
self: super:
let
# nord = prev.lib.rice.palette.tPalette prev.lib.rice.color.hexToRgba (import ./themes/nord.nix);
# onedark = prev.lib.rice.palette.tPalette prev.lib.rice.color.hexToRgba (import ./themes/onedark.nix);
# tomorrow-night = prev.lib.rice.palette.tPalette prev.lib.rice.color.hexToRgba (import ./themes/tomorrow-night.nix);
# mkpm = with prev.lib.rice; palette.tPalette color.hexToRgba (import ./themes/monokai-pro-machine.nix);
# bloom = with prev.lib.rice;
# nord = prev.lib.nix-rice.palette.tPalette prev.lib.nix-rice.color.hexToRgba (import ./themes/nord.nix);
# onedark = prev.lib.nix-rice.palette.tPalette prev.lib.nix-rice.color.hexToRgba (import ./themes/onedark.nix);
# tomorrow-night = prev.lib.nix-rice.palette.tPalette prev.lib.nix-rice.color.hexToRgba (import ./themes/tomorrow-night.nix);
# mkpm = with prev.lib.nix-rice; palette.tPalette color.hexToRgba (import ./themes/monokai-pro-machine.nix);
# bloom = with prev.lib.nix-rice;
# palette.tPalette color.hexToRgba (import ./themes/bloom.nix);
theme = with super.lib.rice;
theme = with super.lib.nix-rice;
kitty-themes.getThemeByName "Catppuccin-Mocha";
in
{
rice = {
colorPalette = with super.lib.rice; rec {
colorPalette = with super.lib.nix-rice; rec {
normal = palette.defaultPalette // {
black = theme.color0;
red = theme.color1;