Compare commits

..

No commits in common. "57100dcead4cf5f511e0cc31780ad156bfbccb1e" and "bdc95279e2cab30f85d649b41e7df229e6d758e0" have entirely different histories.

7 changed files with 63 additions and 87 deletions

View file

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

View file

@ -31,7 +31,7 @@
}; };
inputs = { inputs = {
# nix related # nix related
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/dc460ec76cbff0e66e269457d7b728432263166c"; # TODO: remove when 24.11 is out
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,68 +1,25 @@
{ {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 = mkMerge [ options = {
{ font = "Inter 12";
font = "Inter 12"; selection-notification = true;
selection-notification = true;
selection-clipboard = "clipboard"; selection-clipboard = "clipboard";
adjust-open = "best-fit"; adjust-open = "best-fit";
pages-per-row = "1"; pages-per-row = "1";
scroll-page-aware = "true"; scroll-page-aware = "true";
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;
completion-bg = palette.base02; extraConfig = "include catppuccin-frappe";
completion-fg = palette.base05; };
completion-highlight-bg = palette.base03; xdg.configFile = {
completion-highlight-fg = palette.base05; "zathura/catppuccin-frappe".source = pkgs.fetchurl {
completion-group-bg = palette.base02; url = "https://raw.githubusercontent.com/catppuccin/zathura/main/src/catppuccin-frappe";
completion-group-fg = palette.base0D; hash = "sha256-xdWI/Ai3iE0zRF/9DCxILKmVaNWbfqHm7Xeh6eKM3MY=";
};
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 = lib: color: opacity: let rgba = c: let
r = toString (hexToDec lib (builtins.substring 0 2 color)); r = toString (hexToDec (builtins.substring 0 2 c));
g = toString (hexToDec lib (builtins.substring 2 2 color)); g = toString (hexToDec (builtins.substring 2 2 c));
b = toString (hexToDec lib (builtins.substring 4 2 color)); b = toString (hexToDec (builtins.substring 4 2 c));
in "rgba(${r}, ${g}, ${b}, ${opacity})"; in "rgba(${r}, ${g}, ${b}, .5)";
# 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,16 +32,13 @@ let
"E" = 14; "E" = 14;
"F" = 15; "F" = 15;
}; };
# Remove any leading `#` from the input chars = lib.strings.stringToCharacters v;
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
# Fold over the characters to calculate the decimal value lib.foldl' (a: v: a + v) 0
builtins.foldl' (acc: char: acc * 16 + hexToInt."${char}") 0 chars; (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);
blurImage = pkgs: path: blurImage = pkgs: path:
pkgs.runCommand "${builtins.baseNameOf path}-blurred" { pkgs.runCommand "${builtins.baseNameOf path}-blurred" {

View file

@ -0,0 +1,16 @@
{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,4 +12,5 @@
}) })
.callPackage .callPackage
./bolt-launcher.nix {}; ./bolt-launcher.nix {};
apple-emoji-color = pkgs.callPackage ./apple-emoji-color.nix {};
} }

View file

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