moby: add experimental support for phog greeter

This commit is contained in:
Colin 2023-08-25 01:25:07 +00:00
parent c96b951895
commit fbf62f0531
3 changed files with 88 additions and 48 deletions

View File

@ -65,11 +65,13 @@ in
type = types.bool;
};
sane.gui.sxmo.greeter = mkOption {
type = types.enum [ "lightdm-mobile" "sway" ];
type = types.enum [ "lightdm-mobile" "phog" "sway" ];
default = "lightdm-mobile";
# default = "phog";
description = ''
which greeter to use.
"lightdm-mobile" => keypad style greeter. can only enter digits 0-9 as password.
"phog" => phosh-based greeter. keypad (0-9) with option to open an on-screen keyboard.
"sway" => layered sway greeter. behaves as if you booted to swaylock.
'';
};
@ -343,6 +345,13 @@ in
};
})
(lib.mkIf (cfg.greeter == "phog") {
services.greetd = {
enable = true;
settings.default_session.command = "${pkgs.phog}/bin/phog";
};
})
# old, greeterless options:
# services.xserver.windowManager.session = [{
# name = "sxmo";

View File

@ -25,6 +25,12 @@ in [
hash = "sha256-CjVAFRcnTjA9DpOdwFwifgriQ9QFFGzchMB0tIVlAQM=";
})
(fetchpatch' {
title = "phog: init at 0.1.3";
prUrl = "https://github.com/NixOS/nixpkgs/pull/251249";
hash = "sha256-e38Z7sO7xDQHzE9UOfbptc6vJuONE5eP9JFp2Nzx53E=";
})
# (fetchpatch' {
# # TODO: check back in on this around 2023-10-01
# title = "libkiwix: 12.0.0 -> 12.1.0";

View File

@ -402,14 +402,6 @@ in {
# '';
# });
# 2023/07/27: upstreaming is blocked on p11-kit, argyllcms, libavif cross compilation
colord = prev.colord.overrideAttrs (upstream: {
# fixes: (meson) ERROR: An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH.
nativeBuildInputs = upstream.nativeBuildInputs ++ lib.optionals (!prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform) [
final.mesonEmulatorHook
];
});
# conky = ((useEmulatedStdenv prev.conky).override {
# # docbook2x dependency doesn't cross compile
# docsSupport = prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform;
@ -1324,6 +1316,37 @@ in {
# fixes (meson) "Program 'glib-mkenums mkenums' not found or not executable"
# 2023/07/27: upstreaming is blocked on p11-kit, argyllcms, libavif cross compilation
phoc = mvToNativeInputs [ final.wayland-scanner final.glib ] prev.phoc;
phog = (addInputs
{
depsBuildBuild = [
final.pkg-config # needed by build-aux/post_install.py
];
nativeBuildInputs = [
final.glib
final.wayland-scanner
final.makeBinaryWrapper # not makeWrapper only because nix complains
];
# buildInputs = (upstream.buildInputs or []) ++ [
# # see `data/phog.in`
# # final.squeekboard
# final.bash
# ];
}
prev.phog
).overrideAttrs (upstream: {
DESTDIR = null;
# squeekboard takes 20min to compile because of emulation, so disable it.
# postPatch = (upstream.postPatch or "") + ''
# substituteInPlace data/phog.in \
# --replace " & squeekboard" ""
# '';
postPatch = (upstream.postPatch or "") + ''
sed -i /phog_plugins_dir/d build-aux/post_install.py
'';
postInstall = (upstream.postInstall or "") + ''
wrapProgram $out/bin/phog --prefix PATH : ${lib.makeBinPath [ final.bash final.squeekboard ]}
'';
});
phosh = prev.phosh.overrideAttrs (upstream: {
buildInputs = upstream.buildInputs ++ [
final.libadwaita # "plugins/meson.build:41:2: ERROR: Dependency "libadwaita-1" not found, tried pkgconfig"
@ -1703,47 +1726,49 @@ in {
];
});
# squeekboard = prev.squeekboard.overrideAttrs (upstream: {
# # fixes: "meson.build:1:0: ERROR: 'rust' compiler binary not defined in cross or native file"
# # new error: "meson.build:1:0: ERROR: Rust compiler rustc --target aarch64-unknown-linux-gnu -C linker=aarch64-unknown-linux-gnu-gcc can not compile programs."
# # NB(2023/03/04): upstream nixpkgs has a new squeekboard that's closer to cross-compiling; use that
# mesonFlags =
# let
# # ERROR: 'rust' compiler binary not defined in cross or native file
# crossFile = final.writeText "cross-file.conf" ''
# [binaries]
# rust = [ 'rustc', '--target', '${final.rust.toRustTargetSpec final.stdenv.hostPlatform}' ]
# '';
# in
# # upstream.mesonFlags or [] ++
# [
# "-Dtests=false"
# "-Dnewer=false"
# "-Donline=false"
# ]
# ++ lib.optional
# (final.stdenv.hostPlatform != final.stdenv.buildPlatform)
# "--cross-file=${crossFile}"
# ;
squeekboard = prev.squeekboard.overrideAttrs (upstream: {
# fixes: "meson.build:1:0: ERROR: 'rust' compiler binary not defined in cross or native file"
# new error: "meson.build:1:0: ERROR: Rust compiler rustc --target aarch64-unknown-linux-gnu -C linker=aarch64-unknown-linux-gnu-gcc can not compile programs."
# NB(2023/03/04): upstream nixpkgs has a new squeekboard that's closer to cross-compiling; use that
# NB(2023/08/24): this emulates the entire rust build process
mesonFlags =
let
# ERROR: 'rust' compiler binary not defined in cross or native file
crossFile = final.writeText "cross-file.conf" ''
[binaries]
rust = [ 'rustc', '--target', '${final.rust.toRustTargetSpec final.stdenv.hostPlatform}' ]
'';
in
# upstream.mesonFlags or [] ++
[
"-Dtests=false"
"-Dnewer=true"
"-Donline=false"
]
++ lib.optional
(final.stdenv.hostPlatform != final.stdenv.buildPlatform)
"--cross-file=${crossFile}"
;
# cargoDeps = null;
# cargoVendorDir = "vendor";
# cargoDeps = null;
# cargoVendorDir = "vendor";
# depsBuildBuild = upstream.depsBuildBuild or [] ++ [
# final.pkg-config
# ];
# nativeBuildInputs = with final; [
# meson
# ninja
# pkg-config
# glib
# wayland
# wrapGAppsHook
# rustPlatform.cargoSetupHook
# cargo
# rustc
# ];
# });
depsBuildBuild = upstream.depsBuildBuild or [] ++ [
final.pkg-config
];
# this looks to be identical to upstream: probably not needed?
nativeBuildInputs = with final; [
meson
ninja
pkg-config
glib
wayland
wrapGAppsHook
rustPlatform.cargoSetupHook
cargo
rustc
];
});
# squeekboard = prev.squeekboard.override {
# inherit (emulated)