Compare commits

..

4 commits

7 changed files with 87 additions and 63 deletions

View file

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

View file

@ -31,7 +31,7 @@
};
inputs = {
# 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";
nixos-hardware.url = "github:NixOS/nixos-hardware";
lanzaboote = {

View file

@ -1,25 +1,68 @@
{pkgs, ...}: {
{
osConfig,
lib,
lib',
...
}: let
inherit (osConfig.theme.scheme) palette;
inherit (lib) mkIf mkMerge;
inherit (lib') rgba;
in {
programs.zathura = {
enable = true;
options = {
font = "Inter 12";
selection-notification = true;
options = mkMerge [
{
font = "Inter 12";
selection-notification = true;
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
zoom-min = "10";
};
selection-clipboard = "clipboard";
adjust-open = "best-fit";
pages-per-row = "1";
scroll-page-aware = "true";
scroll-full-overlap = "0.01";
scroll-step = "100";
zoom-min = "10";
}
(mkIf osConfig.theme.enable {
default-fg = palette.base05;
default-bg = palette.base00;
extraConfig = "include catppuccin-frappe";
};
xdg.configFile = {
"zathura/catppuccin-frappe".source = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-frappe";
hash = "sha256-xdWI/Ai3iE0zRF/9DCxILKmVaNWbfqHm7Xeh6eKM3MY=";
};
completion-bg = palette.base02;
completion-fg = palette.base05;
completion-highlight-bg = palette.base03;
completion-highlight-fg = palette.base05;
completion-group-bg = palette.base02;
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
# convert rrggbb hex to rgba(r, g, b, a)
rgba = c: let
r = toString (hexToDec (builtins.substring 0 2 c));
g = toString (hexToDec (builtins.substring 2 2 c));
b = toString (hexToDec (builtins.substring 4 2 c));
in "rgba(${r}, ${g}, ${b}, .5)";
rgba = lib: color: opacity: let
r = toString (hexToDec lib (builtins.substring 0 2 color));
g = toString (hexToDec lib (builtins.substring 2 2 color));
b = toString (hexToDec lib (builtins.substring 4 2 color));
in "rgba(${r}, ${g}, ${b}, ${opacity})";
# Helper function to convert hex color to decimal RGB values
hexToDec = lib: v: let
# Map of hex characters to their decimal values
hexToInt = {
"0" = 0;
"1" = 1;
@ -32,13 +32,16 @@ let
"E" = 14;
"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
lib.foldl' (a: v: a + v) 0
(lib.imap (k: v: hexToInt."${v}" * (pow 16 (builtins.length chars - k - 1))) chars);
# Power function for exponentiation
pow = lib: base: exponent: lib.foldl' (acc: _: acc * base) 1 (lib.range 1 exponent);
# Fold over the characters to calculate the decimal value
builtins.foldl' (acc: char: acc * 16 + hexToInt."${char}") 0 chars;
blurImage = pkgs: path:
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
./bolt-launcher.nix {};
apple-emoji-color = pkgs.callPackage ./apple-emoji-color.nix {};
}

View file

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