Flake: apply catppuccin patch to stable nixpkgs

This commit is contained in:
Toast 2024-01-18 10:27:03 +01:00
parent cbdd6192fe
commit f9986b0d8d
2 changed files with 64 additions and 6 deletions

20
flake.nix Executable file → Normal file
View file

@ -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

View file

@ -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