From e15386f89f8b868da07afb8ebb10d13d2ff9d52a Mon Sep 17 00:00:00 2001 From: yousiki Date: Wed, 17 Apr 2024 18:12:58 +0800 Subject: [PATCH] Add catppuccin module --- cells/darwin/hosts/sakamoto/default.nix | 5 +- cells/home/profiles/catppuccin.nix | 130 ------------------------ cells/home/profiles/core.nix | 4 + cells/home/profiles/shell.nix | 35 ++++++- cells/nixos/hosts/hakase/default.nix | 5 +- flake.lock | 16 +++ flake.nix | 2 + 7 files changed, 57 insertions(+), 140 deletions(-) delete mode 100644 cells/home/profiles/catppuccin.nix diff --git a/cells/darwin/hosts/sakamoto/default.nix b/cells/darwin/hosts/sakamoto/default.nix index 700958a..33c2c96 100644 --- a/cells/darwin/hosts/sakamoto/default.nix +++ b/cells/darwin/hosts/sakamoto/default.nix @@ -18,7 +18,8 @@ { home-manager.users.yousiki = { imports = [ - inputs.cells.home.homeProfiles.catppuccin + inputs.catppuccin.homeManagerModules.catppuccin + inputs.cells.home.homeProfiles.core inputs.cells.home.homeProfiles.languages inputs.cells.home.homeProfiles.shell @@ -32,8 +33,6 @@ "python" "rust" ]; - - bee.home-catppuccin.flavor = "mocha"; }; } ]; diff --git a/cells/home/profiles/catppuccin.nix b/cells/home/profiles/catppuccin.nix deleted file mode 100644 index 9261514..0000000 --- a/cells/home/profiles/catppuccin.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ - inputs, - cell, -}: { - config, - pkgs, - lib, - ... -}: let - l = builtins // lib; - - sources = pkgs.callPackage "${inputs.self}/nvfetcher/generated.nix" {}; - - catppuccin-fzf-colors = { - latte = { - "bg+" = "#ccd0da"; - "bg" = "#eff1f5"; - "spinner" = "#dc8a78"; - "hl" = "#d20f39"; - "fg" = "#4c4f69"; - "header" = "#d20f39"; - "info" = "#8839ef"; - "pointer" = "#dc8a78"; - "marker" = "#dc8a78"; - "fg+" = "#4c4f69"; - "prompt" = "#8839ef"; - "hl+" = "#d20f39"; - }; - frappe = { - "bg+" = "#414559"; - "bg" = "#303446"; - "spinner" = "#f2d5cf"; - "hl" = "#e78284"; - "fg" = "#c6d0f5"; - "header" = "#e78284"; - "info" = "#ca9ee6"; - "pointer" = "#f2d5cf"; - "marker" = "#f2d5cf"; - "fg+" = "#c6d0f5"; - "prompt" = "#ca9ee6"; - "hl+" = "#e78284"; - }; - macchiato = { - "bg+" = "#363a4f"; - "bg" = "#24273a"; - "spinner" = "#f4dbd6"; - "hl" = "#ed8796"; - "fg" = "#cad3f5"; - "header" = "#ed8796"; - "info" = "#c6a0f6"; - "pointer" = "#f4dbd6"; - "marker" = "#f4dbd6"; - "fg+" = "#cad3f5"; - "prompt" = "#c6a0f6"; - "hl+" = "#ed8796"; - }; - mocha = { - "bg+" = "#313244"; - "bg" = "#1e1e2e"; - "spinner" = "#f5e0dc"; - "hl" = "#f38ba8"; - "fg" = "#cdd6f4"; - "header" = "#f38ba8"; - "info" = "#cba6f7"; - "pointer" = "#f5e0dc"; - "marker" = "#f5e0dc"; - "fg+" = "#cdd6f4"; - "prompt" = "#cba6f7"; - "hl+" = "#f38ba8"; - }; - }; -in { - options = { - bee.home-catppuccin.flavor = l.mkOption { - type = lib.types.enum [ - "latte" - "frappe" - "macchiato" - "mocha" - ]; - default = "mocha"; - description = '' - The color scheme to use for catppuccin theme. - ''; - }; - }; - - config = let - flavor = config.bee.home-catppuccin.flavor; - flavors = ["latte" "frappe" "macchiato" "mocha"]; - in { - programs.bat = { - config.theme = "catppuccin-${flavor}"; - themes = l.genAttrs flavors (n: { - src = sources.catppuccin-bat.src; - file = "Catppuccin-${n}.tmTheme"; - }); - }; - - programs.bottom.settings = l.fromTOML ( - l.readFile "${sources.catppuccin-bottom.src}/themes/${flavor}.toml" - ); - - programs.btop.settings.color_scheme = "catppuccin-${flavor}"; - home.file = - l.pipe - flavors - [ - (l.map ( - n: - l.nameValuePair - ".config/btop/themes/catppuccin-${n}.theme" - {source = "${sources.catppuccin-btop.src}/themes/catppuccin_${n}.theme";} - )) - l.listToAttrs - ]; - - programs.fzf.colors = catppuccin-fzf-colors."${flavor}"; - - programs.gitui.theme = l.readFile "${sources.catppuccin-gitui.src}/theme/${flavor}.ron"; - - programs.helix.settings.theme = "catppuccin_${flavor}"; - - programs.starship.settings = - {palette = "catppuccin_${flavor}";} - // l.fromTOML (l.readFile "${sources.catppuccin-starship.src}/palettes/${flavor}.toml"); - - programs.zellij.settings.theme = "catppuccin-${flavor}"; - }; -} diff --git a/cells/home/profiles/core.nix b/cells/home/profiles/core.nix index 5609da2..448645b 100644 --- a/cells/home/profiles/core.nix +++ b/cells/home/profiles/core.nix @@ -16,4 +16,8 @@ in { ); home.stateVersion = "23.05"; + + xdg.enable = true; + + catppuccin.flavour = "mocha"; } diff --git a/cells/home/profiles/shell.nix b/cells/home/profiles/shell.nix index 46417ba..7efc549 100644 --- a/cells/home/profiles/shell.nix +++ b/cells/home/profiles/shell.nix @@ -21,11 +21,18 @@ batwatch prettybat ]; + catppuccin.enable = true; }; - programs.bottom.enable = true; + programs.bottom = { + enable = true; + catppuccin.enable = true; + }; - programs.btop.enable = true; + programs.btop = { + enable = true; + catppuccin.enable = true; + }; programs.direnv = { enable = true; @@ -48,6 +55,7 @@ enableZshIntegration = true; enableFishIntegration = true; tmux.enableShellIntegration = true; + catppuccin.enable = true; }; programs.gh = { @@ -67,6 +75,7 @@ enable = true; lfs.enable = true; delta.enable = true; + delta.catppuccin.enable = true; userName = "yousiki"; userEmail = "you.siki@outlook.com"; extraConfig = { @@ -75,7 +84,10 @@ }; }; - programs.gitui.enable = true; + programs.gitui = { + enable = true; + catppuccin.enable = true; + }; programs.helix = { enable = true; @@ -94,6 +106,12 @@ lsp.display-messages = true; }; }; + catppuccin.enable = true; + }; + + programs.lazygit = { + enable = true; + catppuccin.enable = true; }; programs.mcfly = { @@ -115,9 +133,18 @@ enableNushellIntegration = true; enableTransience = true; settings.format = "$all"; + catppuccin.enable = true; }; - programs.tmux.enable = true; + programs.tmux = { + enable = true; + catppuccin.enable = true; + }; + + programs.yazi = { + enable = true; + catppuccin.enable = true; + }; programs.zellij = { enable = true; diff --git a/cells/nixos/hosts/hakase/default.nix b/cells/nixos/hosts/hakase/default.nix index ed4154f..4cd888b 100644 --- a/cells/nixos/hosts/hakase/default.nix +++ b/cells/nixos/hosts/hakase/default.nix @@ -29,7 +29,8 @@ { home-manager.users.yousiki = { imports = [ - inputs.cells.home.homeProfiles.catppuccin + inputs.catppuccin.homeManagerModules.catppuccin + inputs.cells.home.homeProfiles.core inputs.cells.home.homeProfiles.languages inputs.cells.home.homeProfiles.shell @@ -43,8 +44,6 @@ "python" "rust" ]; - - bee.home-catppuccin.flavor = "mocha"; }; } ]; diff --git a/flake.lock b/flake.lock index c8f69b7..26fd4be 100644 --- a/flake.lock +++ b/flake.lock @@ -53,6 +53,21 @@ "type": "github" } }, + "catppuccin": { + "locked": { + "lastModified": 1713323853, + "narHash": "sha256-EfUm65RRsoch0tpfHZtEyqo+iWIYhuSX39U/fi0/4WU=", + "owner": "catppuccin", + "repo": "nix", + "rev": "372decb578f3187d7aad837885ed98e73e8abd60", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nix", + "type": "github" + } + }, "colmena": { "inputs": { "flake-compat": "flake-compat", @@ -799,6 +814,7 @@ "root": { "inputs": { "agenix": "agenix", + "catppuccin": "catppuccin", "colmena": "colmena", "darwin": "darwin_2", "default-systems": "default-systems", diff --git a/flake.nix b/flake.nix index f63d515..0cd9eec 100644 --- a/flake.nix +++ b/flake.nix @@ -131,6 +131,8 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + catppuccin.url = "github:catppuccin/nix"; }; nixConfig = rec {