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 { } , palette ? rice.palette.palette { }
, ... , ...
}: }:
let strPalette = lib.rice.palette.toRGBAHex palette; let strPalette = lib.nix-rice.palette.toRGBAHex palette;
in writeScriptBin "lockscreen" '' in writeScriptBin "lockscreen" ''
# Using font package ${font.package} # Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \ ${i3lock-color}/bin/i3lock-color \

7
flake.lock generated
View file

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

View file

@ -11,7 +11,7 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
nixos-generators = { url = "github:nix-community/nixos-generators"; inputs = { nixpkgs.follows = "nixpkgs"; }; }; nixos-generators = { url = "github:nix-community/nixos-generators"; inputs = { nixpkgs.follows = "nixpkgs"; }; };
nixos-hardware.url = "github:NixOS/nixos-hardware"; 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"; }; }; 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"; }; }; tex2nix = { url = "github:Mic92/tex2nix"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; };
}; };

View file

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

View file

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

View file

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

View file

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

View file

@ -276,7 +276,7 @@ in
# THEME FILE # THEME FILE
xdg.configFile."kak/colors/nord.kak".text = 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 = '' xdg.configFile."kak-lsp/kak-lsp.toml".text = ''
snippet_support = false snippet_support = false

View file

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

View file

@ -1,5 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
let strPalette = pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette; with pkgs.lib.nix-rice;
let strPalette = palette.toRgbShortHex pkgs.rice.colorPalette;
in { in {
programs.mangohud = { programs.mangohud = {
enable = true; 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}'` session=`${loginctl} session-status | ${pkgs.coreutils}/bin/head -n 1 | ${pkgs.gawk}/bin/awk '{print $1}'`
${loginctl} terminate-session $session ${loginctl} terminate-session $session
''; '';
colors = with pkgs.lib.rice; colors = with pkgs.lib.nix-rice;
let alpha = 255 * opacity; let alpha = 255 * opacity;
in in
palette.toARGBHex rec { palette.toARGBHex rec {

View file

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

View file

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

View file

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

View file

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