Compare commits

..

4 commits

7 changed files with 87 additions and 63 deletions

View file

@ -816,18 +816,17 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1731319897, "lastModified": 1732014248,
"narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "dc460ec76cbff0e66e269457d7b728432263166c", "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "id": "nixpkgs",
"repo": "nixpkgs", "ref": "nixos-unstable",
"rev": "dc460ec76cbff0e66e269457d7b728432263166c", "type": "indirect"
"type": "github"
} }
}, },
"nixpkgs_8": { "nixpkgs_8": {

View file

@ -31,7 +31,7 @@
}; };
inputs = { inputs = {
# nix related # nix related
nixpkgs.url = "github:NixOS/nixpkgs/dc460ec76cbff0e66e269457d7b728432263166c"; # TODO: remove when 24.11 is out nixpkgs.url = "nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux"; systems.url = "github:nix-systems/default-linux";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
lanzaboote = { lanzaboote = {

View file

@ -1,7 +1,17 @@
{pkgs, ...}: { {
osConfig,
lib,
lib',
...
}: let
inherit (osConfig.theme.scheme) palette;
inherit (lib) mkIf mkMerge;
inherit (lib') rgba;
in {
programs.zathura = { programs.zathura = {
enable = true; enable = true;
options = { options = mkMerge [
{
font = "Inter 12"; font = "Inter 12";
selection-notification = true; selection-notification = true;
@ -12,14 +22,47 @@
scroll-full-overlap = "0.01"; scroll-full-overlap = "0.01";
scroll-step = "100"; scroll-step = "100";
zoom-min = "10"; zoom-min = "10";
}; }
(mkIf osConfig.theme.enable {
default-fg = palette.base05;
default-bg = palette.base00;
extraConfig = "include catppuccin-frappe"; completion-bg = palette.base02;
}; completion-fg = palette.base05;
xdg.configFile = { completion-highlight-bg = palette.base03;
"zathura/catppuccin-frappe".source = pkgs.fetchurl { completion-highlight-fg = palette.base05;
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-frappe"; completion-group-bg = palette.base02;
hash = "sha256-xdWI/Ai3iE0zRF/9DCxILKmVaNWbfqHm7Xeh6eKM3MY="; completion-group-fg = palette.base0D;
};
statusbar-fg = palette.base05;
statusbar-bg = palette.base02;
notification-bg = palette.base02;
notification-fg = palette.base05;
notification-error-bg = palette.base02;
notification-error-fg = palette.base08;
notification-warning-bg = palette.base02;
notification-warning-fg = palette.base0A;
inputbar-fg = palette.base05;
inputbar-bg = palette.base02;
recolor = true;
recolor-lightcolor = palette.base00;
recolor-darkcolor = palette.base05;
index-fg = palette.base05;
index-bg = palette.base00;
index-active-fg = palette.base05;
index-active-bg = palette.base02;
render-loading-bg = palette.base00;
render-loading-fg = palette.base05;
highlight-color = rgba lib palette.base03 ".5";
highlight-fg = rgba lib palette.base0E ".5";
highlight-active-color = rgba lib palette.base0E ".5";
})
];
}; };
} }

View file

@ -1,13 +1,13 @@
let let
# convert rrggbb hex to rgba(r, g, b, a) # convert rrggbb hex to rgba(r, g, b, a)
rgba = c: let rgba = lib: color: opacity: let
r = toString (hexToDec (builtins.substring 0 2 c)); r = toString (hexToDec lib (builtins.substring 0 2 color));
g = toString (hexToDec (builtins.substring 2 2 c)); g = toString (hexToDec lib (builtins.substring 2 2 color));
b = toString (hexToDec (builtins.substring 4 2 c)); b = toString (hexToDec lib (builtins.substring 4 2 color));
in "rgba(${r}, ${g}, ${b}, .5)"; in "rgba(${r}, ${g}, ${b}, ${opacity})";
# Helper function to convert hex color to decimal RGB values
hexToDec = lib: v: let hexToDec = lib: v: let
# Map of hex characters to their decimal values
hexToInt = { hexToInt = {
"0" = 0; "0" = 0;
"1" = 1; "1" = 1;
@ -32,13 +32,16 @@ let
"E" = 14; "E" = 14;
"F" = 15; "F" = 15;
}; };
chars = lib.strings.stringToCharacters v; # Remove any leading `#` from the input
cleanHex =
if lib.strings.substring 0 1 v == "#"
then lib.strings.substring 1 (builtins.stringLength v - 1) v
else v;
# Convert the cleaned string into characters
chars = lib.strings.stringToCharacters cleanHex;
in in
lib.foldl' (a: v: a + v) 0 # Fold over the characters to calculate the decimal value
(lib.imap (k: v: hexToInt."${v}" * (pow 16 (builtins.length chars - k - 1))) chars); builtins.foldl' (acc: char: acc * 16 + hexToInt."${char}") 0 chars;
# Power function for exponentiation
pow = lib: base: exponent: lib.foldl' (acc: _: acc * base) 1 (lib.range 1 exponent);
blurImage = pkgs: path: blurImage = pkgs: path:
pkgs.runCommand "${builtins.baseNameOf path}-blurred" { pkgs.runCommand "${builtins.baseNameOf path}-blurred" {

View file

@ -1,16 +0,0 @@
{pkgs, ...}: let
version = "v17.4";
in
pkgs.stdenv.mkDerivation {
inherit version;
name = "apple-color-emoji";
src = pkgs.fetchurl {
url = "https://github.com/samuelngs/apple-emoji-linux/releases/download/${version}/AppleColorEmoji.ttf";
sha256 = "sha256-SG3JQLybhY/fMX+XqmB/BKhQSBB0N1VRqa+H6laVUPE=";
};
phases = ["installPhase"];
installPhase = ''
mkdir -p $out/share/fonts/truetype/apple-color-emoji
cp $src $out/share/fonts/truetype/apple-color-emoji/AppleColorEmoji.ttf
'';
}

View file

@ -12,5 +12,4 @@
}) })
.callPackage .callPackage
./bolt-launcher.nix {}; ./bolt-launcher.nix {};
apple-emoji-color = pkgs.callPackage ./apple-emoji-color.nix {};
} }

View file

@ -4,19 +4,15 @@
... ...
}: { }: {
fonts = { fonts = {
fontDir = { enableDefaultPackages = false;
enable = true;
decompressFonts = true;
};
packages = [ packages = [
pkgs.noto-fonts pkgs.noto-fonts
pkgs.noto-fonts-cjk-sans pkgs.noto-fonts-cjk-sans
pkgs.noto-fonts-extra pkgs.noto-fonts-extra
pkgs.intel-one-mono pkgs.intel-one-mono
inputs.self.packages.${pkgs.system}.apple-emoji-color pkgs.noto-fonts-color-emoji
(pkgs.nerdfonts.override {fonts = ["IntelOneMono" "NerdFontsSymbolsOnly"];}) (pkgs.nerdfonts.override {fonts = ["IntelOneMono" "NerdFontsSymbolsOnly"];})
]; ];
enableDefaultPackages = false;
fontconfig = { fontconfig = {
enable = true; enable = true;
@ -24,7 +20,7 @@
serif = ["Noto Serif"]; serif = ["Noto Serif"];
sansSerif = ["Inter Medium"]; sansSerif = ["Inter Medium"];
monospace = ["IntoneMono NF"]; monospace = ["IntoneMono NF"];
emoji = ["Apple Color Emoji"]; emoji = ["Noto Color Emoji"];
}; };
}; };
}; };