From 3332094c6f69514e2e9158fff9cd6ffb6ac847c3 Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 20 Oct 2023 10:53:13 +0200 Subject: feat(hm/conf/taswarrior): Generate a firefox profile per project --- hm/soispha/conf/taskwarrior/firefox/lib.nix | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 hm/soispha/conf/taskwarrior/firefox/lib.nix (limited to 'hm/soispha/conf/taskwarrior/firefox/lib.nix') diff --git a/hm/soispha/conf/taskwarrior/firefox/lib.nix b/hm/soispha/conf/taskwarrior/firefox/lib.nix new file mode 100644 index 00000000..467b9a73 --- /dev/null +++ b/hm/soispha/conf/taskwarrior/firefox/lib.nix @@ -0,0 +1,30 @@ +{lib, ...}: { + fromHexString = hexString: let + fromHexChar = index: char: + { + "0" = 0; + "1" = 1; + "2" = 2; + "3" = 3; + "4" = 4; + "5" = 5; + "6" = 6; + "7" = 7; + "8" = 8; + "9" = 9; + "A" = 10; + "B" = 11; + "C" = 12; + "D" = 13; + "E" = 14; + "F" = 15; + } + .${lib.strings.toUpper char} + * ( + if index == 0 + then 1 + else index * 16 + ); + in + lib.lists.foldr (a: b: a + b) 0 (lib.lists.imap0 fromHexChar (lib.lists.reverseList (lib.strings.stringToCharacters hexString))); +} -- cgit 1.4.1