forked from lakmeer/zbalermorna
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make things simple for Nix(OS) users #6
Open
lboklin
wants to merge
13
commits into
jackhumbert:master
Choose a base branch
from
lboklin:pr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
870d4c0
Nix derivations
lboklin 6973e34
Fixed licenses. Many of which are unfree.
lboklin b8b7fcd
Added a little tool script for transcription
lboklin 9022855
Add ZLM ibus-table Nix package
lboklin a9ba6b6
Move zlm.sh into default.nix and add ime.sh as zlmi package
lboklin b12ea1f
replace the `zlm` tool with `lerfanva-clip`; clean up; add flake and …
lboklin 78e7974
rename ibus-table => table-zbalermorna and add ibus-engines overlay
lboklin 1cf5b44
Add packages in overlay
lboklin 60ea038
Document the need to use the overlay
lboklin 910342b
Update Nix doc to list proper package/attribute names
lboklin 4aea54e
Point to original repo
lboklin 4cdd895
Update inputs
lboklin 9137535
Change Dunda license from unfree to OFL
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
todo.md | ||
ime/windows/KeyboardVerify.log | ||
_site/* | ||
_site/* | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
# Note that this is not a derivation, but a collection of derivations. | ||
# Use `callPackage` on the derivations herein _after_ importing this. | ||
{ stdenv, fontforge, xclip, ibus-engines }: | ||
|
||
let | ||
lerfanva = stdenv.mkDerivation { | ||
name = "lerfanva"; | ||
src = ./.; | ||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp ime/ime.sh $out/bin/lerfanva | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
version = "0.1.0"; | ||
description = "Transliterate latin text into Zbalermorna"; | ||
homepage = https://github.com/jackhumbert/zbalermorna; | ||
platforms = platforms.linux; | ||
license = licenses.publicDomain; | ||
}; | ||
}; | ||
|
||
lerfanva-clip = stdenv.mkDerivation { | ||
name = "lerfanva-clip"; | ||
src = ./.; | ||
buildInputs = [ lerfanva xclip ]; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
|
||
ln -s ${lerfanva}/bin/lerfanva $out/bin/lerfanva | ||
|
||
cat << EOF > $out/bin/lerfanva-clip | ||
#!/usr/bin/env bash | ||
SEL=0 | ||
case \$1 in | ||
1) SEL=primary;; | ||
2) SEL=secondary;; | ||
*) SEL=clipboard;; | ||
esac | ||
|
||
OUT=\$(${lerfanva}/bin/lerfanva <(echo \$(xclip -o -selection \$SEL))) | ||
echo -n \$OUT | ${xclip}/bin/xclip -selection \$SEL | ||
echo \$OUT | ||
EOF | ||
|
||
chmod +x $out/bin/lerfanva-clip | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
version = "0.1.0"; | ||
description = "Replace clipboard or selection content with its transliteration into Zbalermorna"; | ||
homepage = https://github.com/jackhumbert/zbalermorna; | ||
platforms = platforms.linux; | ||
license = licenses.agpl3; | ||
}; | ||
}; | ||
|
||
mkFontDrv = name: attrs: stdenv.mkDerivation { | ||
inherit name; | ||
inherit (attrs) version; | ||
src = ./.; | ||
buildInputs = [ fontforge ]; | ||
installPhase = '' | ||
mkdir -p $out/share/fonts/zbalermorna | ||
./build.sh ${name} | ||
cp fonts/${name}.otf $out/share/fonts/zbalermorna | ||
''; | ||
|
||
meta = { | ||
inherit (attrs) | ||
version | ||
license; | ||
description = "A font for the Zbalermorna writing system of the language Lojban"; | ||
homepage = https://github.com/jackhumbert/zbalermorna; | ||
platforms = stdenv.lib.platforms.linux; | ||
}; | ||
}; | ||
|
||
table-zbalermorna = let version = "0.1.0"; in with ibus-engines; stdenv.mkDerivation { | ||
name = "table-zbalermorna"; | ||
inherit version; | ||
src = ./.; | ||
buildInputs = [ table ]; | ||
buildPhase = '' | ||
export HOME=$TMP | ||
${table}/bin/ibus-table-createdb -n zlm.db -s ime/zlm.ibus | ||
''; | ||
installPhase = '' | ||
TABLE_LOCATION=$out/share/ibus-table/tables | ||
mkdir -p $TABLE_LOCATION | ||
cp zlm.db $TABLE_LOCATION/zlm.db | ||
# TODO: Add icon? What icon to use? Where to get it from? Where do you put it? | ||
# cp assets/img/favicon.png $out/share/ibus-table/??? | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
isIbusEngine = true; | ||
inherit version; | ||
description = "Basic input method for Zbalermorna text"; | ||
homepage = https://github.com/jackhumbert/zbalermorna; | ||
platforms = platforms.linux; | ||
license = licenses.lgpl3; | ||
}; | ||
}; | ||
|
||
fonts = builtins.mapAttrs mkFontDrv (with stdenv.lib.licenses; { | ||
# I extracted versions with: grep -oE '^Version: .*$' src/*.sfd | ||
balvi-regular = { | ||
version = "1.001"; | ||
license = ofl; | ||
}; | ||
crisa-light = { | ||
version = "2.015"; | ||
license = ofl; | ||
}; | ||
crisa-regular = { | ||
version = "0.1"; | ||
license = ofl; | ||
}; | ||
dunda-regular = { | ||
version = "1.10"; | ||
license = unfree; | ||
}; | ||
fira-code-zlm = { | ||
version = "1.208"; | ||
license = ofl; | ||
}; | ||
lavi-zlm = { | ||
version = "2.0"; | ||
license = gpl3; | ||
}; | ||
lobster-zlm = { | ||
version = "001.001"; | ||
license = unfree; | ||
}; | ||
nerfopi-regular = { | ||
version = "001.001"; | ||
license = unfree; | ||
}; | ||
piper-karot = { | ||
version = "1.1"; | ||
license = ofl; | ||
}; | ||
primihi-regular = { | ||
version = "2008.02.06"; | ||
license = publicDomain; | ||
}; | ||
ritli-regular = { | ||
version = "0.1"; | ||
license = gpl3; | ||
}; | ||
tanbo-regular = { | ||
version = "2.000"; | ||
license = asl20; | ||
}; | ||
tisna-bold = { | ||
version = "0.1"; | ||
license = asl20; | ||
}; | ||
tnr-zlm = { | ||
version = "001.000"; | ||
license = unfree; | ||
}; | ||
unicode-drakono = { | ||
version = "001.000"; | ||
license = unfree; | ||
}; | ||
unicode-manri = { | ||
version = "001.000"; | ||
license = unfree; | ||
}; | ||
unifont = { | ||
version = "12.1.02"; | ||
license = gpl2; | ||
}; | ||
vrude-italic-regular = { | ||
version = "1.200"; | ||
license = ofl; | ||
}; | ||
vrude-regular = { | ||
version = "1.200"; | ||
license = ofl; | ||
}; | ||
zlm-manri = { | ||
version = "001.000"; | ||
license = unfree; | ||
}; | ||
zlm-template = { | ||
version = "0.1"; | ||
license = ofl; | ||
}; | ||
zlm-tnr = { | ||
version = "001.000"; | ||
license = unfree; | ||
}; | ||
}); | ||
|
||
in { | ||
inherit | ||
lerfanva | ||
lerfanva-clip | ||
table-zbalermorna; | ||
} // fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Using nix to get started with Zbalermorna | ||
|
||
(includes IME via ibus for NixOS users) | ||
|
||
See the available packages in `./default.nix`, which includes the fonts found in `./fonts.nix`. At the time of writing this includes: | ||
* lerfanva | ||
* lerfanva-clip | ||
* ibus-table | ||
* balvi-regular | ||
* crisa-light | ||
* crisa-regular | ||
* dunda-regular | ||
* fira-code-zlm | ||
* lavi-zlm | ||
* lobster-zlm | ||
* nerfopi-regular | ||
* piper-karot | ||
* primihi-regular | ||
* ritli-regular | ||
* tanbo-regular | ||
* tisna-bold | ||
* tnr-zlm | ||
* unicode-drakono | ||
* unicode-manri | ||
* unifont | ||
* vrude-italic-regular | ||
* vrude-regular | ||
* zlm-manri | ||
* zlm-template | ||
* zlm-tnr | ||
|
||
|
||
## On NixOS | ||
|
||
Using [Nix flakes](https://www.tweag.io/blog/2020-07-31-nixos-flakes/): | ||
``` | ||
{ description = "NixOS configuration with flakes"; | ||
|
||
inputs.zbalermorna.url = github:jackhumbert/zbalermorna; | ||
|
||
outputs = { self, nixpkgs, zbalermorna }: { | ||
# replace <your-hostname> with your actual hostname | ||
nixosConfigurations.<your-hostname> = nixpkgs.lib.nixosSystem { | ||
|
||
# ... | ||
|
||
# add to your overlay so that the packages appear in pkgs | ||
nixpkgs.overlays = [ | ||
# ... | ||
zbalermorna.overlay | ||
]; | ||
|
||
# You'll want at least the typical fonts | ||
fonts = with pkgs.zbalermorna; [ crisa-regular fira-code-zlm ]; | ||
|
||
# If you want to be able to input zbalermorna characters directly | ||
i18n.inputMethod = { | ||
enabled = "ibus"; | ||
ibus.engines = with pkgs.ibus-engines; [ table zbalermorna.ibus-table ]; | ||
# optional (relevant only for plasma users) | ||
# ibus.panel = "${pkgs.plasma5.plasma-desktop}/libexec/kimpanel-ibus-panel"; | ||
}; | ||
|
||
environment.systemPackages = with pkgs.zbalermorna; [ | ||
lerfanva | ||
lerfanva-clip | ||
]; | ||
}; | ||
}; | ||
} | ||
``` | ||
|
||
### Without using flakes: | ||
|
||
|
||
Add it to your configuration.nix: | ||
``` | ||
{ config, pkgs, ... }: | ||
|
||
# see below for how to get zbalermorna.nix. | ||
let | ||
zbalermorna = pkgs.callPackage (import /path/to/zbalermorna.nix) {}; | ||
|
||
in { | ||
# ... | ||
|
||
# You'll want at least the typical fonts | ||
fonts = with pkgs.zbalermorna; [ crisa-regular fira-code-zlm ]; | ||
|
||
# If you want to be able to input zbalermorna characters directly | ||
i18n.inputMethod = { | ||
enabled = "ibus"; | ||
ibus.engines = with pkgs.ibus-engines; [ table zbalermorna.ibus-table ]; | ||
# optional (relevant only for plasma users) | ||
# ibus.panel = "${pkgs.plasma5.plasma-desktop}/libexec/kimpanel-ibus-panel"; | ||
}; | ||
|
||
environment.systemPackages = with pkgs.zbalermorna; [ | ||
lerfanva | ||
lerfanva-clip | ||
]; | ||
} | ||
|
||
``` | ||
|
||
## Using home-manager | ||
|
||
Note: This does not account for IME, only the fonts and lerfanva tools. | ||
|
||
In your `home.nix`: | ||
```nix | ||
{ pkgs, ... }: | ||
|
||
let | ||
# see below for how to get zbalermorna.nix. | ||
zbalermorna = pkgs.callPackage (import /path/to/zbalermorna.nix) {}; | ||
|
||
in { | ||
fonts.fontconfig.enable = true; | ||
home.packages = with zbalermorna; [ | ||
lerfanva | ||
lerfanva-clip | ||
crisa-regular | ||
fira-code-zlm | ||
]; | ||
} | ||
``` | ||
|
||
## Getting the derivation without using flakes | ||
|
||
```bash | ||
cd /path/to/wherever/you/want/it | ||
nix run nixpkgs.nix-prefetch-github -c nix-prefetch-github --nix --prefetch jackhumbert zbalermorna > zbalermorna.nix | ||
``` | ||
or use `fetchFromGitHub` directly in the appropriate nix expression to get the source. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? The font description (at least as stated in font manager when imported) says it's modified from Lato family, which is SIL OFL, and the license is copyleft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so then I'll happily change it to OFL! I just couldn't find any explicitly stated license for it at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I hope you're right (too lazy to verify myself) but what makes me hesitate is just that it's supposedly1 based on Tengwar Annatar which I can't find a license for. Is that one also modified Lato?
I really don't mind eagerly enforcing copyleft, so I'll take your suggestion for now.
Footnotes
stated here: https://jackhumbert.github.io/zbalermorna/fonts ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can kindly ask @Alatius what is the current license of the Tengwar Annatar and if it is not SIL OFL, if it it is possible to license it as such
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the pdf included in the files for Tengwar Annatar it explicitly says freeware, copyright belonging to @Alatius. If it can't be open sourced, then the only way Dunda may be considered OFL is if was merely inspired by it but actually a modification of Lato. I don't think "inspired by" is grounds for copyright infringement.