add Fennel support

phoen
Daniel Barlow 2022-04-26 21:14:46 +01:00
parent 74a1c01900
commit b7ab3d1f31
4 changed files with 41 additions and 3 deletions

View File

@ -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

View File

@ -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 = ./.;
}

6
init.lua Normal file
View File

@ -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")

4
rc.fnl Normal file
View File

@ -0,0 +1,4 @@
(kiwmi:on "output" #(doto $1 (: :set_mode 360 720 0)))
(kiwmi:spawn "swaybg -c '#ff00ff'")
(kiwmi:spawn "foot")