diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-07-22 12:27:42 -0300 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-08-01 10:04:14 +0000 |
commit | f048ac137f809dff57840e08928f729aa8e5a4d9 (patch) | |
tree | 877cdb733e13eb7880a80e3275ee5d04bada423b /pkgs/applications/networking/browsers | |
parent | 7fa7e07fdf9eb684d9d59cffc390ec8d38c8137f (diff) |
netsurf: rewrite
To make the expression more clean and modern.
Diffstat (limited to 'pkgs/applications/networking/browsers')
-rw-r--r-- | pkgs/applications/networking/browsers/netsurf/default.nix | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/pkgs/applications/networking/browsers/netsurf/default.nix b/pkgs/applications/networking/browsers/netsurf/default.nix index 409ab80ce3acc..36bfe10d5d240 100644 --- a/pkgs/applications/networking/browsers/netsurf/default.nix +++ b/pkgs/applications/networking/browsers/netsurf/default.nix @@ -1,20 +1,23 @@ { lib, pkgs }: -lib.makeScope pkgs.newScope (self: with self; { +lib.makeScope pkgs.newScope (self: + let + inherit (self) callPackage; + in { # ui can be: gtk2, gtk3, sixel, framebuffer. Note that console display (sixel) # requires a terminal that supports `sixel` capabilities, such as mlterm # or xterm -ti 340 ui = "gtk3"; - uilib = - if ui == "gtk2" || - ui == "gtk3" || - ui == "framebuffer" then ui - else if ui == "sixel" then "framebuffer" - else null; # Never will happen - SDL = - if ui == "sixel" then pkgs.SDL_sixel - else if ui == "framebuffer" then pkgs.SDL - else null; + uilib = { + "framebuffer" = "framebuffer"; + "gtk2" = "gtk2"; + "gtk3" = "gtk3"; + "sixel" = "framebuffer"; + }.${self.ui} or null; # Null will never happen + SDL = { + "sixel" = pkgs.SDL_sixel; + "framebuffer" = pkgs.SDL; + }.${self.ui} or null; browser = callPackage ./browser.nix { }; |