mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-23 02:39:40 +01:00
nyxt: add module (#7232)
This commit is contained in:
parent
f23b0935a3
commit
2835e8ba0a
7 changed files with 169 additions and 0 deletions
|
|
@ -219,6 +219,7 @@ let
|
||||||
./programs/notmuch.nix
|
./programs/notmuch.nix
|
||||||
./programs/numbat.nix
|
./programs/numbat.nix
|
||||||
./programs/nushell.nix
|
./programs/nushell.nix
|
||||||
|
./programs/nyxt.nix
|
||||||
./programs/obs-studio.nix
|
./programs/obs-studio.nix
|
||||||
./programs/obsidian.nix
|
./programs/obsidian.nix
|
||||||
./programs/octant.nix
|
./programs/octant.nix
|
||||||
|
|
|
||||||
82
modules/programs/nyxt.nix
Normal file
82
modules/programs/nyxt.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
types
|
||||||
|
isString
|
||||||
|
mkIf
|
||||||
|
mkEnableOption
|
||||||
|
mkPackageOption
|
||||||
|
mkOption
|
||||||
|
;
|
||||||
|
|
||||||
|
cfg = config.programs.nyxt;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||||
|
|
||||||
|
options.programs.nyxt = {
|
||||||
|
enable = mkEnableOption "Nyxt";
|
||||||
|
package = mkPackageOption pkgs "nyxt" { nullable = true; };
|
||||||
|
config = mkOption {
|
||||||
|
type = with types; either lines path;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
(in-package #:nyxt-user)
|
||||||
|
|
||||||
|
(defvar *my-search-engines*
|
||||||
|
(list
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "Google"
|
||||||
|
:shortcut "goo"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://duckduckgo.com/?q=~a")
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "MDN"
|
||||||
|
:shortcut "mdn"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://developer.mozilla.org/en-US/search?q=~a")))
|
||||||
|
|
||||||
|
(define-configuration browser
|
||||||
|
((restore-session-on-startup-p nil)
|
||||||
|
(default-new-buffer-url (quri:uri "https://github.com/atlas-engineer/nyxt"))
|
||||||
|
(external-editor-program (if (member :flatpak *features*)
|
||||||
|
"flatpak-spawn --host emacsclient -r"
|
||||||
|
"emacsclient -r"))
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engine-suggestions-p nil)
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engines (append %slot-default% *my-search-engines*))
|
||||||
|
;; Sets the font for the Nyxt UI (not for webpages).
|
||||||
|
(theme (make-instance 'theme:theme
|
||||||
|
:font-family "Iosevka"
|
||||||
|
:monospace-font-family "Iosevka"))
|
||||||
|
;; Whether code sent to the socket gets executed. You must understand the
|
||||||
|
;; risks before enabling this: a privileged user with access to your system
|
||||||
|
;; can then take control of the browser and execute arbitrary code under your
|
||||||
|
;; user profile.
|
||||||
|
;; (remote-execution-p t)
|
||||||
|
))
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration file for Nyxt, written in the Common Lisp
|
||||||
|
programming language.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
xdg.configFile."nyxt/config.lisp" = mkIf (cfg.config != "") {
|
||||||
|
source =
|
||||||
|
let
|
||||||
|
configSource = if isString cfg.config then pkgs.writeText "nyxt-config" cfg.config else cfg.config;
|
||||||
|
in
|
||||||
|
configSource;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -109,6 +109,7 @@ let
|
||||||
"notmuch"
|
"notmuch"
|
||||||
"npth"
|
"npth"
|
||||||
"nushell"
|
"nushell"
|
||||||
|
"nyxt"
|
||||||
"oh-my-posh"
|
"oh-my-posh"
|
||||||
"ollama"
|
"ollama"
|
||||||
"onlyoffice-desktopeditors"
|
"onlyoffice-desktopeditors"
|
||||||
|
|
|
||||||
|
|
@ -266,6 +266,7 @@ import nmtSrc {
|
||||||
./modules/programs/nnn
|
./modules/programs/nnn
|
||||||
./modules/programs/numbat
|
./modules/programs/numbat
|
||||||
./modules/programs/nushell
|
./modules/programs/nushell
|
||||||
|
./modules/programs/nyxt
|
||||||
./modules/programs/oh-my-posh
|
./modules/programs/oh-my-posh
|
||||||
./modules/programs/onlyoffice
|
./modules/programs/onlyoffice
|
||||||
./modules/programs/openstackclient
|
./modules/programs/openstackclient
|
||||||
|
|
|
||||||
1
tests/modules/programs/nyxt/default.nix
Normal file
1
tests/modules/programs/nyxt/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{ nyxt-example-config = ./example-config.nix; }
|
||||||
35
tests/modules/programs/nyxt/example-config.lisp
Normal file
35
tests/modules/programs/nyxt/example-config.lisp
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
(in-package #:nyxt-user)
|
||||||
|
|
||||||
|
(defvar *my-search-engines*
|
||||||
|
(list
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "Google"
|
||||||
|
:shortcut "goo"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://duckduckgo.com/?q=~a")
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "MDN"
|
||||||
|
:shortcut "mdn"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://developer.mozilla.org/en-US/search?q=~a")))
|
||||||
|
|
||||||
|
(define-configuration browser
|
||||||
|
((restore-session-on-startup-p nil)
|
||||||
|
(default-new-buffer-url (quri:uri "https://github.com/atlas-engineer/nyxt"))
|
||||||
|
(external-editor-program (if (member :flatpak *features*)
|
||||||
|
"flatpak-spawn --host emacsclient -r"
|
||||||
|
"emacsclient -r"))
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engine-suggestions-p nil)
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engines (append %slot-default% *my-search-engines*))
|
||||||
|
;; Sets the font for the Nyxt UI (not for webpages).
|
||||||
|
(theme (make-instance 'theme:theme
|
||||||
|
:font-family "Iosevka"
|
||||||
|
:monospace-font-family "Iosevka"))
|
||||||
|
;; Whether code sent to the socket gets executed. You must understand the
|
||||||
|
;; risks before enabling this: a privileged user with access to your system
|
||||||
|
;; can then take control of the browser and execute arbitrary code under your
|
||||||
|
;; user profile.
|
||||||
|
;; (remote-execution-p t)
|
||||||
|
))
|
||||||
48
tests/modules/programs/nyxt/example-config.nix
Normal file
48
tests/modules/programs/nyxt/example-config.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
programs.nyxt = {
|
||||||
|
enable = true;
|
||||||
|
config = ''
|
||||||
|
(in-package #:nyxt-user)
|
||||||
|
|
||||||
|
(defvar *my-search-engines*
|
||||||
|
(list
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "Google"
|
||||||
|
:shortcut "goo"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://duckduckgo.com/?q=~a")
|
||||||
|
(make-instance 'search-engine
|
||||||
|
:name "MDN"
|
||||||
|
:shortcut "mdn"
|
||||||
|
#+nyxt-4 :control-url #+nyxt-3 :search-url
|
||||||
|
"https://developer.mozilla.org/en-US/search?q=~a")))
|
||||||
|
|
||||||
|
(define-configuration browser
|
||||||
|
((restore-session-on-startup-p nil)
|
||||||
|
(default-new-buffer-url (quri:uri "https://github.com/atlas-engineer/nyxt"))
|
||||||
|
(external-editor-program (if (member :flatpak *features*)
|
||||||
|
"flatpak-spawn --host emacsclient -r"
|
||||||
|
"emacsclient -r"))
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engine-suggestions-p nil)
|
||||||
|
#+nyxt-4
|
||||||
|
(search-engines (append %slot-default% *my-search-engines*))
|
||||||
|
;; Sets the font for the Nyxt UI (not for webpages).
|
||||||
|
(theme (make-instance 'theme:theme
|
||||||
|
:font-family "Iosevka"
|
||||||
|
:monospace-font-family "Iosevka"))
|
||||||
|
;; Whether code sent to the socket gets executed. You must understand the
|
||||||
|
;; risks before enabling this: a privileged user with access to your system
|
||||||
|
;; can then take control of the browser and execute arbitrary code under your
|
||||||
|
;; user profile.
|
||||||
|
;; (remote-execution-p t)
|
||||||
|
))
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/nyxt/config.lisp
|
||||||
|
assertFileContent home-files/.config/nyxt/config.lisp \
|
||||||
|
${./example-config.lisp}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue