2024-09-20 08:33:10 +01:00
|
|
|
{ config, pkgs, ... }:
|
2024-07-30 15:06:34 +01:00
|
|
|
{
|
|
|
|
home.packages = [ pkgs.nyxt ];
|
2024-07-03 07:15:39 +01:00
|
|
|
xdg = {
|
|
|
|
configFile = {
|
2024-07-30 15:06:34 +01:00
|
|
|
"nyxt/config.lisp".text =
|
|
|
|
let
|
2024-09-20 08:33:10 +01:00
|
|
|
fonts = config.stylix.fonts;
|
|
|
|
scheme = config.lib.stylix.scheme;
|
2024-07-30 15:06:34 +01:00
|
|
|
in
|
|
|
|
''
|
|
|
|
;; Import custom configuration
|
|
|
|
(nyxt::load-lisp "${./config.lisp}")
|
|
|
|
;; Define custom theme
|
|
|
|
(define-configuration browser
|
|
|
|
((theme (make-instance 'theme:theme
|
|
|
|
:dark-p t
|
|
|
|
:font-family "${fonts.sansSerif.name}"
|
|
|
|
:monospace-font-family "${fonts.monospace.name}"
|
2024-09-20 08:33:10 +01:00
|
|
|
:background-color "${scheme.withHashtag.base00}"
|
|
|
|
:on-background-color "${scheme.withHashtag.base05}"
|
|
|
|
:primary-color "${scheme.withHashtag.base02}"
|
|
|
|
:on-primary-color "${scheme.withHashtag.base05}"
|
|
|
|
:secondary-color "${scheme.withHashtag.base03}"
|
|
|
|
:on-secondary-color "${scheme.withHashtag.base05}"
|
2024-10-25 12:19:00 +01:00
|
|
|
:accent-color "${scheme.withHashtag.base0E}"
|
2024-09-20 08:33:10 +01:00
|
|
|
:on-accent-color "${scheme.withHashtag.base01}"
|
|
|
|
:action-color "${scheme.withHashtag.cyan}"
|
|
|
|
:on-action-color "${scheme.withHashtag.base01}"
|
|
|
|
:success-color "${scheme.withHashtag.green}"
|
|
|
|
:on-success-color "${scheme.withHashtag.base01}"
|
|
|
|
:highlight-color "${scheme.withHashtag.magenta}"
|
|
|
|
:on-highlight-color "${scheme.withHashtag.base01}"
|
|
|
|
:warning-color "${scheme.withHashtag.yellow}"
|
|
|
|
:on-warning-color "${scheme.withHashtag.base01}"
|
|
|
|
:codeblock-color "${scheme.withHashtag.base02}"
|
|
|
|
:on-codeblock-color "${scheme.withHashtag.base05}"))))
|
2024-07-30 15:06:34 +01:00
|
|
|
'';
|
2024-07-03 07:15:39 +01:00
|
|
|
};
|
2024-07-30 15:06:34 +01:00
|
|
|
dataFile."nyxt/bookmarks.lisp".text =
|
|
|
|
let
|
|
|
|
# Make a string of lisp-style list of strings, from nix-style
|
|
|
|
# list
|
|
|
|
convertTags = tags: "(" + (builtins.foldl' (x: y: x + " \"" + y + "\"") "" tags) + " )";
|
|
|
|
# Take bookmarks as returned from JSON file and convert to NYXT
|
|
|
|
# expected format
|
|
|
|
convertBookmark =
|
|
|
|
{
|
|
|
|
name,
|
|
|
|
tags,
|
|
|
|
url,
|
|
|
|
}:
|
|
|
|
"(:url \"${url}\" :title \"${name}\" :tags ${convertTags tags})\n";
|
|
|
|
in
|
|
|
|
(
|
|
|
|
# Fold all entries in bookmarks.json into single string of NYXT
|
|
|
|
# format bookmarks, each entry on a new line and with 2 space
|
|
|
|
# indentation, just for visual clarity if reading the outputted
|
|
|
|
# file
|
|
|
|
"(\n"
|
|
|
|
+ (builtins.foldl' (x: y: x + " " + convertBookmark y) "" (
|
|
|
|
builtins.fromJSON (builtins.readFile ./bookmarks.json)
|
|
|
|
))
|
|
|
|
+ ")"
|
|
|
|
);
|
2024-07-03 07:15:39 +01:00
|
|
|
};
|
|
|
|
}
|