commit b7ab3d1f31d84c4a4c4ed83dcd71fa5edd58d60c
parent 74a1c0190016f1506f6008113ca1c4d8fb764509
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 26 Apr 2022 21:14:46 +0100
add Fennel support
Diffstat:
4 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
@@ -1,3 +1,26 @@
# eufon
> *euphony*: _noun_ Harmonious arrangement of sounds in composition; a smooth and agreeable combination of articulate elements in any piece of writing.
+
+A mostly Fennel-based graphical environment tailored for the Pinephone
+(other Linux-based mobile devices exist). The principles we aspire to are
+
+* "habitable software" - build the system in such a way that a
+ technically competent user may change it to serve their needs,
+ potentially even in ways that weren't anticipated in the original
+ design. Emacs has this quality.
+
+* optimised for touchscreens. My phone has no hardware keyboard and few
+ hardware buttons, let's play to its strengths instead of compensating for
+ its weaknesses
+
+As of 2022 these principles are more aspirational than actual.
+
+## Running it
+
+ $ nix-shell build.nix
+ nix-shell$ lua -e 'os.execute("kiwmi -c init.lua")'
+
+This is suboptimally hairy, at least for the moment: Nix makes a
+wrapper script for the Lua executable that has appropriate `LUA_PATH`
+and `LUA_CPATH` settings, but it doesn't do the same for kiwmi
diff --git a/default.nix b/default.nix
@@ -1,14 +1,19 @@
{ stdenv
, callPackage
+, fennel
, lua5_3
-
} :
let
- kiwmi = callPackage ./kiwmi.nix { lua = lua5_3; };
+ fennel_ = (fennel.override { lua = lua5_3; });
+ luaWithPackages = lua5_3.withPackages (ps: with ps; [
+ (toLuaModule fennel_)
+ busted
+ ]);
+ kiwmi = callPackage ./kiwmi.nix { lua = luaWithPackages; };
in
stdenv.mkDerivation {
pname = "eufon";
version = "0.1";
- buildInputs = [ kiwmi ];
+ buildInputs = [ luaWithPackages kiwmi ];
src = ./.;
}
diff --git a/init.lua b/init.lua
@@ -0,0 +1,6 @@
+print(os.getenv("LUA_PATH"))
+print(os.getenv("LUA_CPATH"))
+
+local fennel = require("fennel")
+table.insert(package.loaders or package.searchers, fennel.searcher)
+fennel.dofile("rc.fnl")
diff --git a/rc.fnl b/rc.fnl
@@ -0,0 +1,4 @@
+(kiwmi:on "output" #(doto $1 (: :set_mode 360 720 0)))
+
+(kiwmi:spawn "swaybg -c '#ff00ff'")
+(kiwmi:spawn "foot")