initial commit

phoen
Daniel Barlow 2022-02-04 23:47:14 +00:00
parent 804be0660c
commit a137495482
2 changed files with 85 additions and 0 deletions

46
just/default.nix Normal file
View File

@ -0,0 +1,46 @@
{ stdenv
, callPackage
, fetchFromGitHub
, fetchurl
, gobject-introspection
, gtk3
, gnome3
, lib
, librsvg
, lua53Packages
, lua5_3
, makeWrapper
, writeText
}:
let fennel = fetchurl {
name = "fennel.lua";
url = "https://fennel-lang.org/downloads/fennel-1.0.0";
hash = "sha256:1nha32yilzagfwrs44hc763jgwxd700kaik1is7x7lsjjvkgapw7";
};
webkitgtk = gnome3.webkitgtk;
# dbusProxy = callPackage ./dbus-proxy.nix {
# inherit (lua53Packages) lgi buildLuaPackage;
# lua = lua5_3;
# };
lua = lua5_3.withPackages (ps: with ps; [
# dbusProxy
# inifile
inspect
lgi
luafilesystem
luaposix
readline
]);
in stdenv.mkDerivation {
pname = "just";
version = "0.1";
src =./.;
inherit fennel;
buildInputs = [ lua gtk3 webkitgtk gobject-introspection.dev ];
nativeBuildInputs = [ lua makeWrapper ];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
}

39
just/just.fnl Normal file
View File

@ -0,0 +1,39 @@
(local lgi (require :lgi))
(local inspect (require :inspect))
(local Gtk lgi.Gtk)
(local WebKit2 lgi.WebKit2)
(let [current-url "about:blank"
window (Gtk.Window {
:title "Just browsing"
:default_width 800
:default_height 600
:on_destroy Gtk.main_quit
})
container (Gtk.Box {
:orientation Gtk.Orientation.VERTICAL
})
nav-bar (Gtk.Box {
:orientation Gtk.Orientation.HORIZONTAL
})
webview (WebKit2.WebView)
back (Gtk.Button {
:label "<-"
})
url (doto (Gtk.Entry) (: :set_text current-url))]
(nav-bar:pack_start back false false 5)
(nav-bar:pack_start url true true 5)
(container:pack_start nav-bar false false 5)
(container:pack_start webview true true 5)
(webview:load_uri current-url)
(window:add container)
(window:show_all))
(Gtk.main)