From 412d7cc2831b67d631cdb9e04ca37791ed3acd31 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sun, 1 Jan 2023 18:01:38 +0100 Subject: [PATCH] Switch to nix-rice 0.3.1 --- custom/lockscreen/default.nix | 2 +- flake.lock | 7 +++--- flake.nix | 2 +- hm_modules/alacritty.nix | 2 +- hm_modules/bspwm.nix | 4 ++-- hm_modules/cava.nix | 2 +- hm_modules/dunst.nix | 21 ++++++++-------- hm_modules/kakoune.nix | 2 +- hm_modules/kitty.nix | 4 ++-- hm_modules/mangohud.nix | 3 ++- hm_modules/polybar.nix | 2 +- hm_modules/terminator.nix | 45 +++++++++++++++++------------------ hm_modules/twmn.nix | 9 +++---- hm_modules/zathura.nix | 3 ++- rice.nix | 14 +++++------ 15 files changed, 63 insertions(+), 59 deletions(-) diff --git a/custom/lockscreen/default.nix b/custom/lockscreen/default.nix index f2e6a13..16e1f84 100644 --- a/custom/lockscreen/default.nix +++ b/custom/lockscreen/default.nix @@ -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 \ diff --git a/flake.lock b/flake.lock index 6d5f2f3..f1070f4 100644 --- a/flake.lock +++ b/flake.lock @@ -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" } diff --git a/flake.nix b/flake.nix index ac4fe5f..dcb8af1 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; }; }; diff --git a/hm_modules/alacritty.nix b/hm_modules/alacritty.nix index dd49103..3184df0 100644 --- a/hm_modules/alacritty.nix +++ b/hm_modules/alacritty.nix @@ -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; diff --git a/hm_modules/bspwm.nix b/hm_modules/bspwm.nix index 8e90dfc..c89b6ed 100644 --- a/hm_modules/bspwm.nix +++ b/hm_modules/bspwm.nix @@ -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 = { diff --git a/hm_modules/cava.nix b/hm_modules/cava.nix index 9ce0268..6eeabe1 100644 --- a/hm_modules/cava.nix +++ b/hm_modules/cava.nix @@ -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 { diff --git a/hm_modules/dunst.nix b/hm_modules/dunst.nix index 67fa40c..3df61de 100644 --- a/hm_modules/dunst.nix +++ b/hm_modules/dunst.nix @@ -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 = { diff --git a/hm_modules/kakoune.nix b/hm_modules/kakoune.nix index 8e7ca02..dd97af0 100644 --- a/hm_modules/kakoune.nix +++ b/hm_modules/kakoune.nix @@ -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 diff --git a/hm_modules/kitty.nix b/hm_modules/kitty.nix index 2155156..2462a3e 100644 --- a/hm_modules/kitty.nix +++ b/hm_modules/kitty.nix @@ -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 diff --git a/hm_modules/mangohud.nix b/hm_modules/mangohud.nix index c1ab20a..27b6835 100644 --- a/hm_modules/mangohud.nix +++ b/hm_modules/mangohud.nix @@ -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; diff --git a/hm_modules/polybar.nix b/hm_modules/polybar.nix index acba923..d472189 100644 --- a/hm_modules/polybar.nix +++ b/hm_modules/polybar.nix @@ -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 { diff --git a/hm_modules/terminator.nix b/hm_modules/terminator.nix index f07a284..f89a165 100644 --- a/hm_modules/terminator.nix +++ b/hm_modules/terminator.nix @@ -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 ]; diff --git a/hm_modules/twmn.nix b/hm_modules/twmn.nix index 9100237..c2ecffb 100644 --- a/hm_modules/twmn.nix +++ b/hm_modules/twmn.nix @@ -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; }; }; }; diff --git a/hm_modules/zathura.nix b/hm_modules/zathura.nix index c353138..9c61374 100644 --- a/hm_modules/zathura.nix +++ b/hm_modules/zathura.nix @@ -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; diff --git a/rice.nix b/rice.nix index e68323e..31a02be 100644 --- a/rice.nix +++ b/rice.nix @@ -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;