summary refs log tree commit diff
path: root/pkgs/applications/networking
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-07-22 12:27:42 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-01 10:04:14 +0000
commitf048ac137f809dff57840e08928f729aa8e5a4d9 (patch)
tree877cdb733e13eb7880a80e3275ee5d04bada423b /pkgs/applications/networking
parent7fa7e07fdf9eb684d9d59cffc390ec8d38c8137f (diff)
downloadnixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar.gz
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar.bz2
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar.lz
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar.xz
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.tar.zst
nixpkgs-f048ac137f809dff57840e08928f729aa8e5a4d9.zip
netsurf: rewrite
To make the expression more clean and modern.
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/browsers/netsurf/default.nix25
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 409ab80ce3a..36bfe10d5d2 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 { };