From bd43302fd8f4913bffeb7fcdede8d05a897be916 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sat, 31 Dec 2022 00:14:35 +0100 Subject: [PATCH] kitty-themes based rice --- flake.lock | 162 +++++++++++++++++++++++++++++++++++------ flake.nix | 2 +- hm_modules/helix.nix | 2 +- hm_modules/kitty.nix | 42 ++++++----- hm_modules/polybar.nix | 22 +++--- rice.nix | 33 ++++++--- 6 files changed, 196 insertions(+), 67 deletions(-) diff --git a/flake.lock b/flake.lock index b0ba321..1699300 100644 --- a/flake.lock +++ b/flake.lock @@ -74,6 +74,22 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -89,7 +105,44 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { + "inputs": { + "nixpkgs": [ + "nix-rice", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "pre-commit-hooks", @@ -134,26 +187,40 @@ "type": "github" } }, + "kitty-themes": { + "flake": false, + "locked": { + "lastModified": 1669518372, + "narHash": "sha256-PGV/iPg7nFW8RMEMJbt1oGcAzTaS3u6I+sCpIDrx7ic=", + "owner": "kovidgoyal", + "repo": "kitty-themes", + "rev": "4d309e984b81dd120d7a697abe4f817da6f3cfe5", + "type": "github" + }, + "original": { + "owner": "kovidgoyal", + "repo": "kitty-themes", + "type": "github" + } + }, "nix-rice": { "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ], + "flake-utils": "flake-utils_2", + "kitty-themes": "kitty-themes", + "nixpkgs-lib": "nixpkgs-lib", "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1666602436, - "narHash": "sha256-1XqDIzbqBjJSCxx+r/qHYxRGJnaeBWMTNoOY1bEY+uc=", + "lastModified": 1672440409, + "narHash": "sha256-Bz+rXbFOsKmlnl33FJ9jQx27WQu0BPquRyZEfin4aQQ=", "owner": "bertof", "repo": "nix-rice", - "rev": "82ec325c24f35d628a41575819c4ae76a853a942", + "rev": "265d5df8ccbe20a1fcc78d7e0d07eb1062ea570d", "type": "github" }, "original": { "owner": "bertof", + "ref": "testing", "repo": "nix-rice", "type": "github" } @@ -211,21 +278,52 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670939335, - "narHash": "sha256-AJmruD+RI6smxiVnfpmNT7275mZsUdCS5zczeQCyy3o=", + "lastModified": 1671271357, + "narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8d6da33644bbd082b8a13f73ea2c7338190d7429", + "rev": "40f79f003b6377bd2f4ed4027dde1f8f922995dd", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-22.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1671929364, + "narHash": "sha256-N9GW06FZTKDpkv9YLMXswUxnX27b9qEtfTg7WsSdXjc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a909f7a2fb4ec6d14d52b8a727bb9ba465e15766", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs-stable": { + "locked": { + "lastModified": 1671271954, + "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1668984258, "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=", @@ -257,23 +355,39 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1670939335, + "narHash": "sha256-AJmruD+RI6smxiVnfpmNT7275mZsUdCS5zczeQCyy3o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8d6da33644bbd082b8a13f73ea2c7338190d7429", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { + "flake-compat": "flake-compat_2", "flake-utils": [ "nix-rice", "flake-utils" ], - "nixpkgs": [ - "nix-rice", - "nixpkgs" - ] + "gitignore": "gitignore", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1666160137, - "narHash": "sha256-8bQu+6poMzUyS2n3C1v3hkO6ZhRzj8Pf3CDCNckqQE4=", + "lastModified": 1672050129, + "narHash": "sha256-GBQMcvJUSwAVOpDjVKzB6D5mmHI7Y4nFw+04bnS9QrM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e6c8efee1c108bb27522b9fd25b1cd0eb3288681", + "rev": "67d98f02443b9928bc77f1267741dcfdd3d7b65c", "type": "github" }, "original": { @@ -284,15 +398,15 @@ }, "pre-commit-hooks_2": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-utils": [ "flake-utils" ], - "gitignore": "gitignore", + "gitignore": "gitignore_2", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1670413394, @@ -317,7 +431,7 @@ "nix-rice": "nix-rice", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-u": "nixpkgs-u", "pre-commit-hooks": "pre-commit-hooks_2", "tex2nix": "tex2nix" diff --git a/flake.nix b/flake.nix index cef1a9d..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"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; + 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/helix.nix b/hm_modules/helix.nix index d5b1932..4e8f893 100644 --- a/hm_modules/helix.nix +++ b/hm_modules/helix.nix @@ -40,7 +40,7 @@ in package = pkgs.unstable.helix; languages = [ ]; settings = { - theme = "ayu_mirage"; + theme = "evergreen_dark"; editor.lsp.display-messages = true; editor.scrolloff = 5; editor.true-color = true; diff --git a/hm_modules/kitty.nix b/hm_modules/kitty.nix index 2884ef4..2155156 100644 --- a/hm_modules/kitty.nix +++ b/hm_modules/kitty.nix @@ -1,25 +1,27 @@ { pkgs, ... }: let - strPalette = with pkgs.rice; - pkgs.lib.rice.palette.toRgbHex rec { - inherit (colorPalette.primary) background foreground; - color0 = colorPalette.normal.black; - color1 = colorPalette.normal.red; - color2 = colorPalette.normal.green; - color3 = colorPalette.normal.yellow; - color4 = colorPalette.normal.blue; - color5 = colorPalette.normal.magenta; - color6 = colorPalette.normal.cyan; - color7 = colorPalette.normal.white; - color8 = colorPalette.bright.black; - color9 = colorPalette.bright.red; - color10 = colorPalette.bright.green; - color11 = colorPalette.bright.yellow; - color12 = colorPalette.bright.blue; - color13 = colorPalette.bright.magenta; - color14 = colorPalette.bright.cyan; - color15 = colorPalette.bright.white; - }; + strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex { + inherit (colorPalette) + background + foreground + color0 + color1 + color2 + color3 + color4 + color5 + color6 + color7 + color8 + color9 + color10 + color11 + color12 + color13 + color14 + color15 + ; + }; in { programs.kitty = { diff --git a/hm_modules/polybar.nix b/hm_modules/polybar.nix index 9d36125..207db4b 100644 --- a/hm_modules/polybar.nix +++ b/hm_modules/polybar.nix @@ -33,20 +33,20 @@ let palette.toARGBHex rec { normal = { - foreground = colorPalette.normal.white; - background = color.setAlphaRgba alpha colorPalette.normal.black; - underline = colorPalette.dark.blue; + foreground = color.darken 10 colorPalette.foreground; + background = color.setAlphaRgba alpha colorPalette.background; + underline = colorPalette.normal.blue; }; active = { - foreground = colorPalette.bright.white; - background = color.setAlphaRgba alpha colorPalette.normal.black; + inherit (colorPalette) foreground; + background = color.setAlphaRgba alpha colorPalette.background; underline = colorPalette.normal.yellow; }; selected = { - foreground = colorPalette.bright.white; - background = color.setAlphaRgba alpha (color.brighten 10 colorPalette.bright.black); + inherit (colorPalette) foreground; + background = color.setAlphaRgba alpha colorPalette.background; underline = colorPalette.bright.red; }; @@ -193,12 +193,12 @@ in }; in { - focused = recursiveUpdate colors.selected common; - occupied = recursiveUpdate colors.active common; - urgent = recursiveUpdate (recursiveUpdate colors.active common) { + focused = recursiveUpdate common colors.selected; + occupied = recursiveUpdate common colors.active; + urgent = recursiveUpdate (recursiveUpdate common colors.active) { background = colors.alert; }; - empty = recursiveUpdate (recursiveUpdate colors.normal common) { + empty = recursiveUpdate (recursiveUpdate common colors.normal) { # text = "⏺"; padding = 1; }; diff --git a/rice.nix b/rice.nix index afc86eb..48987ee 100644 --- a/rice.nix +++ b/rice.nix @@ -6,26 +6,39 @@ let # mkpm = with prev.lib.rice; palette.tPalette color.hexToRgba (import ./themes/monokai-pro-machine.nix); # bloom = with prev.lib.rice; # palette.tPalette color.hexToRgba (import ./themes/bloom.nix); - ayu-mirage = with super.lib.rice; - palette.tPalette color.hexToRgba (import ./themes/ayu-mirage.nix); + theme = with super.lib.rice; + kitty-themes.getThemeByName "everforest_dark_medium"; in rec { rice = { colorPalette = with super.lib.rice; rec { normal = palette.defaultPalette // { - inherit (ayu-mirage.normal) black red green yellow blue magenta cyan white; + black = theme.color0; + red = theme.color1; + green = theme.color2; + yellow = theme.color0; + blue = theme.color4; + magenta = theme.color5; + cyan = theme.color6; + white = theme.color7; }; bright = palette.brighten 10 normal // { - inherit (ayu-mirage.bright) black red green yellow blue magenta cyan white; + black = theme.color8; + red = theme.color9; + green = theme.color10; + yellow = theme.color11; + blue = theme.color12; + magenta = theme.color13; + cyan = theme.color14; + white = theme.color15; }; dark = palette.darken 10 normal; primary = { - background = color.black; - foreground = color.white; - bright_foreground = color.white; - dim_foreground = dark.white; - } // ayu-mirage.primary; - }; + inherit (theme) background foreground; + bright_foreground = color.brighten 10 theme.foreground; + dim_foreground = color.darken 10 theme.foreground; + }; + } // theme; font = { normal = { name = "Cantarell";