From f9986b0d8d9b0bd638c6672fd624b76b2bd8bf6f Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 18 Jan 2024 10:27:03 +0100 Subject: [PATCH] Flake: apply catppuccin patch to stable nixpkgs --- flake.nix | 20 +++++--- .../0001-catppuccin-add-starship-theme.patch | 50 +++++++++++++++++++ 2 files changed, 64 insertions(+), 6 deletions(-) mode change 100755 => 100644 flake.nix create mode 100644 nixpkgs-patches/0001-catppuccin-add-starship-theme.patch diff --git a/flake.nix b/flake.nix old mode 100755 new mode 100644 index 427a665..a627754 --- a/flake.nix +++ b/flake.nix @@ -2,20 +2,20 @@ description = "Configuration for Everest"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs-raw.url = "nixpkgs/nixos-23.11"; nixpkgs-unstable-raw.url = "nixpkgs/nixos-unstable"; agenix = { url = "github:ryantm/agenix"; inputs = { - nixpkgs.follows = "nixpkgs"; + nixpkgs.follows = "nixpkgs-raw"; darwin.follows = ""; # Not using this on MacOS, so this doesn't pull it's dependencies }; }; home-manager = { url = "github:nix-community/home-manager/release-23.11"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs-raw"; }; home-manager-unstable = { @@ -38,7 +38,7 @@ */ nix-index-db = { url = "github:Mic92/nix-index-database"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs-raw"; }; nix-index-db-unstable = { @@ -69,7 +69,7 @@ # Patch nixpkgs # https://ertt.ca/nix/patch-nixpkgs/ let - nixpkgs-unstable-patched = nixpkgs.legacyPackages.x86_64-linux.applyPatches { + nixpkgs-unstable-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches { name = "patched-nixpkgs-unstable"; src = nixpkgs-unstable-raw; patches = [ @@ -77,8 +77,16 @@ ./nixpkgs-patches/pr281207.patch ]; }; + nixpkgs-patched = nixpkgs-raw.legacyPackages.x86_64-linux.applyPatches { + name = "patched-nixpkgs"; + src = nixpkgs-raw; + patches = [ + ./nixpkgs-patches/0001-catppuccin-add-starship-theme.patch + ]; + }; # https://discourse.nixos.org/t/proper-way-of-applying-patch-to-system-managed-via-flake/21073/26 nixpkgs-unstable = (import "${nixpkgs-unstable-patched}/flake.nix").outputs { self = inputs.self; }; + nixpkgs = (import "${nixpkgs-patched}/flake.nix").outputs { self = inputs.self; }; in { devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell { @@ -177,7 +185,7 @@ Everest = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { systemPkgs = inputs.nixpkgs; flakeSelf = self; }; + specialArgs = { systemPkgs = inputs.nixpkgs-raw; flakeSelf = self; }; modules = [ agenix.nixosModules.default home-manager.nixosModule diff --git a/nixpkgs-patches/0001-catppuccin-add-starship-theme.patch b/nixpkgs-patches/0001-catppuccin-add-starship-theme.patch new file mode 100644 index 0000000..217f681 --- /dev/null +++ b/nixpkgs-patches/0001-catppuccin-add-starship-theme.patch @@ -0,0 +1,50 @@ +From 8a73b27f67158e8161fc33a61cae2ebd3aa6c625 Mon Sep 17 00:00:00 2001 +From: Toast <39011842+toast003@users.noreply.github.com> +Date: Sat, 13 Jan 2024 18:41:51 +0100 +Subject: [PATCH] catppuccin: add starship theme + +(cherry picked from commit cf1dfaa32a0201cc14801ebb93b5ef865d42522a) +--- + pkgs/data/themes/catppuccin/default.nix | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/pkgs/data/themes/catppuccin/default.nix b/pkgs/data/themes/catppuccin/default.nix +index 59e030eb9e0e..6db2679a9d72 100644 +--- a/pkgs/data/themes/catppuccin/default.nix ++++ b/pkgs/data/themes/catppuccin/default.nix +@@ -1,5 +1,5 @@ + let +- validThemes = [ "bat" "bottom" "btop" "hyprland" "k9s" "kvantum" "lazygit" "plymouth" "refind" "rofi" "waybar" ]; ++ validThemes = [ "bat" "bottom" "btop" "grub" "hyprland" "k9s" "kvantum" "lazygit" "plymouth" "qt5ct" "refind" "rofi" "starship" "waybar" ]; + in + { fetchFromGitHub + , lib +@@ -96,6 +96,14 @@ let + hash = "sha256-DNorfyl3C4RBclF2KDgwvQQwixpTwSRu7fIvihPN8JY="; + }; + ++ starship = fetchFromGitHub { ++ name = "starship"; ++ owner = "catppuccin"; ++ repo = "starship"; ++ rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f"; ++ hash = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0="; ++ }; ++ + waybar = fetchFromGitHub { + name = "waybar"; + owner = "catppuccin"; +@@ -171,6 +179,10 @@ stdenvNoCC.mkDerivation { + cp ${sources.refind}/${variant}.conf $out/refind/ + cp -r ${sources.refind}/assets/${variant} $out/refind/assets/ + ++ '' + lib.optionalString (lib.elem "starship" themeList) '' ++ mkdir -p $out/starship ++ cp ${sources.starship}/palettes/${variant}.toml $out/starship/ ++ + '' + lib.optionalString (lib.elem "waybar" themeList) '' + mkdir -p $out/waybar + cp ${sources.waybar}/${variant}.css $out/waybar/ +-- +2.42.0 +