├── pkgs ├── proycon-wayout │ ├── remove-werror.patch │ └── default.nix ├── codemadness-frontends │ ├── 001-link-dynamically.patch │ └── default.nix ├── sxmo-dmenu │ └── default.nix ├── sxmo-st │ └── default.nix ├── sxmo-utils │ ├── 006-system-manages-pipewire.patch │ ├── 008-fix-status-bar.patch │ ├── 001-fix-makefile-appscript-symlinks.patch │ ├── 003-repoint-config-paths.patch │ ├── 007-xdg-data-path.patch │ └── default.nix ├── sxmo-dwm │ └── default.nix ├── autologin │ └── default.nix ├── mnc │ └── default.nix ├── vvmd │ └── default.nix ├── superd │ └── default.nix ├── tinydm │ ├── default.nix │ └── 001-use-xdg-data-dirs.patch └── mmsd-tng │ └── default.nix ├── LICENSE ├── modules ├── autologin │ └── default.nix ├── sxmo │ └── default.nix └── tinydm │ └── default.nix ├── default.nix └── README.md /pkgs/proycon-wayout/remove-werror.patch: -------------------------------------------------------------------------------- 1 | diff --git a/meson.build b/meson.build 2 | index 2a0ca5f..a4f7a51 100644 3 | --- a/meson.build 4 | +++ b/meson.build 5 | @@ -6,7 +6,6 @@ project( 6 | default_options: [ 7 | 'c_std=c11', 8 | 'warning_level=3', 9 | - 'werror=true', 10 | ] 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2022 Matthew Egeler 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /pkgs/codemadness-frontends/001-link-dynamically.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index 57e590b..8ebaf27 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -10,7 +10,7 @@ FRONTENDS_CFLAGS = -I../ -I. ${CFLAGS} 6 | FRONTENDS_CPPFLAGS = ${CPPFLAGS} 7 | FRONTENDS_LDFLAGS = ${LDFLAGS} 8 | LIBTLS_LDFLAGS = -ltls 9 | -LIBTLS_LDFLAGS_STATIC = -ltls -lssl -lcrypto -static 10 | +LIBTLS_LDFLAGS_STATIC = -ltls -lssl -lcrypto 11 | 12 | # Linux 13 | #FRONTENDS_CFLAGS = -I../ -I. -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 ${CFLAGS} 14 | -------------------------------------------------------------------------------- /pkgs/sxmo-dmenu/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, pkgs, lib, fetchFromSourcehut, dmenu, ...}: 2 | 3 | (dmenu.overrideAttrs (oldAttrs: rec { 4 | name = "smxo-dmenu"; 5 | version = "5.0.14"; 6 | 7 | src = fetchFromSourcehut { 8 | owner = "~mil"; 9 | repo = "sxmo-dmenu"; 10 | rev = version; 11 | sha256 = "sha256-r5E1XhefEvUKRpMVGp/77ewzUHNTc6CuiFtQwjh4CWk="; 12 | }; 13 | 14 | meta = with lib; { 15 | description = "Dmenu for sxmo"; 16 | homepage = "https://git.sr.ht/~mil/sxmo-dmenu"; 17 | license = licenses.mit; 18 | platforms = platforms.linux; 19 | maintainers = with maintainers; [ wentam ]; 20 | }; 21 | })) 22 | -------------------------------------------------------------------------------- /pkgs/sxmo-st/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, pkgs, lib, fetchFromSourcehut, st, ...}: 2 | 3 | (st.overrideAttrs (oldAttrs: rec { 4 | name = "smxo-st"; 5 | version = "0.8.4.1"; 6 | 7 | src = fetchFromSourcehut { 8 | owner = "~mil"; 9 | repo = "sxmo-st"; 10 | rev = version; 11 | sha256 = "sha256-yqm1/hZq+ekAfyplmOm4wcf4QEs1/RXXhYa4fgMGhNo="; 12 | }; 13 | 14 | meta = with lib; { 15 | description = "St terminal emulator for sxmo."; 16 | homepage = "https://git.sr.ht/~mil/sxmo-st"; 17 | license = licenses.mit; 18 | platforms = platforms.linux; 19 | maintainers = with maintainers; [ wentam ]; 20 | }; 21 | })) 22 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/006-system-manages-pipewire.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh 2 | index 94255f9..d23ca6f 100755 3 | --- a/configs/default_hooks/sxmo_hook_start.sh 4 | +++ b/configs/default_hooks/sxmo_hook_start.sh 5 | @@ -20,11 +20,6 @@ while ! superctl status > /dev/null 2>&1; do 6 | sleep 0.1 7 | done 8 | 9 | -# Load our sound daemons 10 | -# pipewire-pulse will start pipewire 11 | -superctl start pipewire-pulse 12 | -superctl start wireplumber 13 | - 14 | # mako/dunst are required for warnings. 15 | # load some other little things here too. 16 | case "$SXMO_WM" in 17 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/008-fix-status-bar.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configs/default_hooks/sxmo_hook_statusbar.sh b/configs/default_hooks/sxmo_hook_statusbar.sh 2 | index 9c3496a..4e6f541 100644 3 | --- a/configs/default_hooks/sxmo_hook_statusbar.sh 4 | +++ b/configs/default_hooks/sxmo_hook_statusbar.sh 5 | @@ -105,7 +105,7 @@ _modem() { 6 | # FAILED, UNKNOWN 7 | # see https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Flags-and-Enumerations.html#MMModemState 8 | sxmo_log "WARNING: MODEMSTATUS: $MODEMSTATUS" 9 | - printf "<%s>" "$MODEMSTATUS" 10 | + printf "%s" "$MODEMSTATUS" 11 | ;; 12 | esac 13 | fi 14 | -------------------------------------------------------------------------------- /pkgs/sxmo-dwm/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, pkgs, lib, fetchFromSourcehut, dwm, ...}: 2 | 3 | (dwm.overrideAttrs (oldAttrs: rec { 4 | name = "smxo-dwm"; 5 | version = "6.2.17"; 6 | 7 | src = fetchFromSourcehut { 8 | owner = "~mil"; 9 | repo = "sxmo-dwm"; 10 | rev = version; 11 | sha256 = "sha256-/q4QdXWDlNkhsLudAehAxofDs7BCMRAPna0S9gDZjZs="; 12 | }; 13 | 14 | meta = with lib; { 15 | description = "Dwm for sxmo - multikey, swallow, dock, among other patches."; 16 | homepage = "https://git.sr.ht/~mil/sxmo-dwm"; 17 | license = licenses.mit; 18 | platforms = platforms.linux; 19 | maintainers = with maintainers; [ wentam ]; 20 | }; 21 | })) 22 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/001-fix-makefile-appscript-symlinks.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile b/Makefile 2 | index 3c47028..e7fc460 100644 3 | --- a/Makefile 4 | +++ b/Makefile 5 | @@ -81,7 +81,7 @@ install-scripts: $(PROGRAMS) 6 | 7 | # Appscripts 8 | mkdir -p "$(DESTDIR)$(PREFIX)/share/sxmo/appscripts" 9 | - cd scripts/appscripts && find . -name 'sxmo_*.sh' | xargs -I{} ln -fs "$(PREFIX)/bin/{}" "$(DESTDIR)$(PREFIX)/share/sxmo/appscripts/{}" && cd ../.. 10 | + cd scripts/appscripts && find . -name 'sxmo_*.sh' | xargs -I{} ln -fs "$(DESTDIR)$(PREFIX)/bin/{}" "$(DESTDIR)$(PREFIX)/share/sxmo/appscripts/{}" && cd ../.. 11 | 12 | 13 | mkdir -p "$(DESTDIR)$(PREFIX)/share/superd/services" 14 | -------------------------------------------------------------------------------- /modules/autologin/default.nix: -------------------------------------------------------------------------------- 1 | {config, options, lib, pkgs, ...}: 2 | 3 | with lib; 4 | 5 | let 6 | sxmopkgs = import ../../default.nix { inherit pkgs; }; 7 | in 8 | { 9 | imports = []; 10 | options = { 11 | programs.autologin = { 12 | enable = lib.mkOption { 13 | type = lib.types.bool; 14 | default = false; 15 | description = ""; 16 | }; 17 | }; 18 | }; 19 | 20 | config = lib.mkIf config.programs.autologin.enable { 21 | environment.systemPackages = [ sxmopkgs.autologin ]; 22 | 23 | security.pam.services."autologin" = { 24 | startSession = true; 25 | allowNullPassword = true; 26 | showMotd = true; 27 | updateWtmp = true; 28 | }; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/autologin/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, lib, fetchFromSourcehut, meson, ninja, pam, ...}: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "autologin"; 5 | version = "1.0.0"; 6 | 7 | src = fetchFromSourcehut { 8 | owner = "~kennylevinsen"; 9 | repo = "autologin"; 10 | rev = version; 11 | sha256 = "sha256-Cy4v/1NuaiSr5Bl6SQMWk5rga8h1QMBUkHpN6M3bWOc="; 12 | }; 13 | 14 | nativeBuildInputs = [ meson ninja ]; 15 | buildInputs = [ pam ]; 16 | 17 | meta = with lib; { 18 | description = "It logs you in. Automatically."; 19 | homepage = "https://git.sr.ht/~kennylevinsen/autologin"; 20 | license = licenses.gpl3; 21 | platforms = platforms.linux; 22 | maintainers = with maintainers; [ wentam ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /pkgs/mnc/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , pkgs 3 | , lib 4 | , fetchFromSourcehut 5 | , buildGoModule 6 | }: 7 | 8 | buildGoModule rec { 9 | pname = "mnc"; 10 | version = "0.4"; 11 | vendorSha256 = "sha256-H0KmGTWyjZOZLIEWophCwRYPeKLxBC050RI7cMXNbPs="; 12 | 13 | src = fetchFromSourcehut { 14 | owner = "~anjan"; 15 | repo = "mnc"; 16 | rev = version; 17 | sha256 = "sha256-S7MBIxuYI+cc8OMQULt7VS7ouPqhq0Jk+rz6E5GyKac="; 18 | }; 19 | 20 | meta = with lib; { 21 | description = "Opens the user's crontab and echos the time when the next cronjob will be ran."; 22 | homepage = "https://git.sr.ht/~anjan/mnc"; 23 | license = licenses.unlicense; 24 | platforms = platforms.linux; 25 | maintainers = with maintainers; [ wentam ]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /pkgs/vvmd/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , lib 3 | , fetchFromGitLab 4 | , meson 5 | , pkg-config 6 | , cmake 7 | , mobile-broadband-provider-info 8 | , glib 9 | , modemmanager 10 | , curl 11 | , libphonenumber 12 | , ninja 13 | , protobuf 14 | }: 15 | 16 | stdenv.mkDerivation rec { 17 | pname = "vvmd"; 18 | version = "0.11"; 19 | 20 | src = fetchFromGitLab { 21 | owner = "kop316"; 22 | repo = "vvmd"; 23 | rev = version; 24 | sha256 = "sha256-aunygF8DfQwXIHrzgvikN2Zf6HP80x1j8CHbLTW7BrU="; 25 | }; 26 | 27 | nativeBuildInputs = [ meson pkg-config cmake ]; 28 | buildInputs = [ mobile-broadband-provider-info glib modemmanager curl libphonenumber ninja protobuf ]; 29 | 30 | meta = with lib; { 31 | description = "A lower level daemon that retrieves Visual Voicemail"; 32 | homepage = "https://gitlab.com/kop316/vvmd/"; 33 | license = licenses.gpl2; 34 | platforms = platforms.linux; 35 | maintainers = with maintainers; [ wentam ]; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/superd/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, pkgs, lib, fetchFromSourcehut, buildGoModule, scdoc, ...}: 2 | 3 | buildGoModule rec { 4 | pname = "superd"; 5 | version = "0.3.2"; 6 | vendorSha256 = "sha256-u9xEtuTqhVjKV29bfwW4tHu3HTk45UqH+yC+XQYQdQA="; 7 | 8 | nativeBuildInputs = [ scdoc ]; 9 | 10 | src = fetchFromSourcehut { 11 | owner = "~craftyguy"; 12 | repo = "superd"; 13 | rev = version; 14 | sha256 = "sha256-yPwenjvSMz2yt8g7WXTrYyhjkZygEPsUKcKCYSj4tDs="; 15 | }; 16 | 17 | postInstall = '' 18 | # Install man pages 19 | make doc 20 | mkdir -p $out/man/man1 $out/man/man5 21 | install -m 0644 superd.1 $out/man/man1/ 22 | install -m 0644 superd.service.5 $out/man/man5/ 23 | install -m 0644 superctl.1 $out/man/man1/ 24 | ''; 25 | 26 | meta = with lib; { 27 | description = "A user service supervisor"; 28 | homepage = "https://git.sr.ht/~craftyguy/superd"; 29 | license = licenses.gpl3; 30 | platforms = platforms.linux; 31 | maintainers = with maintainers; [ wentam ]; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /pkgs/tinydm/default.nix: -------------------------------------------------------------------------------- 1 | {stdenv, pkgs, lib, fetchFromGitLab, ...}: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "tinydm"; 5 | version = "1.1.2"; 6 | 7 | src = fetchFromGitLab { 8 | owner = "postmarketOS"; 9 | repo = "tinydm"; 10 | rev = version; 11 | sha256 = "sha256-6wmjquhumQHFgE9Hf5bn9fWfqQ5G3nAIvxuGwr5tLpM="; 12 | }; 13 | 14 | patches = [ 15 | ./001-use-xdg-data-dirs.patch 16 | ]; 17 | 18 | buildInputs = [ pkgs.gcc pkgs.busybox ]; 19 | buildPhase = '':''; 20 | installPhase = '' 21 | mkdir -p $out/bin 22 | install -Dm755 tinydm-run-session.sh $out/bin/tinydm-run-session 23 | install -Dm755 tinydm-set-session.sh $out/bin/tinydm-set-session 24 | install -Dm755 tinydm-unset-session.sh $out/bin/tinydm-unset-session 25 | ''; 26 | #prePatch = ''''; 27 | 28 | meta = with lib; { 29 | description = "Tiny wayland / x11 session starter for single user machines"; 30 | homepage = "https://gitlab.com/postmarketOS/tinydm"; 31 | license = licenses.gpl3; 32 | platforms = platforms.linux; 33 | maintainers = with maintainers; [ wentam ]; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import { } }: 2 | 3 | rec { 4 | lib = import ./lib { inherit pkgs; }; # functions 5 | modules = import ./modules; # NixOS modules 6 | overlays = import ./overlays; # nixpkgs overlays 7 | 8 | sxmo-dwm = pkgs.callPackage ./pkgs/sxmo-dwm {}; 9 | sxmo-st = pkgs.callPackage ./pkgs/sxmo-st {}; 10 | sxmo-dmenu = pkgs.callPackage ./pkgs/sxmo-dmenu {}; 11 | superd = pkgs.callPackage ./pkgs/superd {}; 12 | tinydm = pkgs.callPackage ./pkgs/tinydm {}; 13 | autologin = pkgs.callPackage ./pkgs/autologin {}; 14 | proycon-wayout = pkgs.callPackage ./pkgs/proycon-wayout {}; 15 | mnc = pkgs.callPackage ./pkgs/mnc {}; 16 | mmsd-tng = pkgs.callPackage ./pkgs/mmsd-tng {}; 17 | codemadness-frontends = pkgs.callPackage ./pkgs/codemadness-frontends {}; 18 | vvmd = pkgs.callPackage ./pkgs/vvmd {}; 19 | sxmo-utils = pkgs.callPackage ./pkgs/sxmo-utils { 20 | inherit 21 | codemadness-frontends 22 | mmsd-tng 23 | mnc 24 | superd 25 | vvmd 26 | sxmo-dwm 27 | sxmo-dmenu 28 | sxmo-st 29 | ; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/003-repoint-config-paths.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configs/appcfg/dunst.conf b/configs/appcfg/dunst.conf 2 | index 487723b..e66e8e0 100644 3 | --- a/configs/appcfg/dunst.conf 4 | +++ b/configs/appcfg/dunst.conf 5 | @@ -24,7 +24,7 @@ 6 | show_indicators = yes 7 | icon_position = left 8 | max_icon_size = 32 9 | - icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ 10 | + icon_path = /run/current-system/sw/share/icons/gnome/16x16/status/:/run/current-system/sw/share/icons/gnome/16x16/devices/ 11 | sticky_history = yes 12 | history_length = 20 13 | dmenu = /usr/bin/dmenu -p dunst: 14 | diff --git a/configs/appcfg/sway_template b/configs/appcfg/sway_template 15 | index c326dc8..f21ae7a 100644 16 | --- a/configs/appcfg/sway_template 17 | +++ b/configs/appcfg/sway_template 18 | @@ -206,6 +206,6 @@ include /etc/sway/config.d/* 19 | 20 | exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock' 21 | 22 | -output * bg /usr/share/sxmo/background.jpg fill 23 | +output * bg /run/current-system/sw/share/sxmo/background.jpg fill 24 | 25 | exec sxmo_hook_start.sh 26 | -------------------------------------------------------------------------------- /pkgs/proycon-wayout/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , lib 3 | , fetchFromSourcehut 4 | , meson 5 | , wayland-protocols 6 | , wayland 7 | , cairo 8 | , pango 9 | , scdoc 10 | , ninja 11 | , cmake 12 | , pkg-config 13 | , wayland-scanner 14 | }: 15 | 16 | stdenv.mkDerivation rec { 17 | pname = "proycon-wayout"; 18 | version = "0.1.3"; 19 | 20 | src = fetchFromSourcehut { 21 | owner = "~proycon"; 22 | repo = "wayout"; 23 | rev = version; 24 | sha256 = "sha256-pxHz8y63xX9I425OG0jPvQVx4mAbTYHxVMMkfjZpURo="; 25 | }; 26 | 27 | depsBuildBuild = [ pkg-config ]; 28 | nativeBuildInputs = [ scdoc ninja meson cmake pkg-config wayland-scanner ]; 29 | buildInputs = [ wayland-protocols wayland cairo pango wayland-scanner ]; 30 | 31 | fixupPhase = '' 32 | mv $out/bin/wayout $out/bin/proycon-wayout # avoid conflict with shinyzenith/wayout 33 | ''; 34 | 35 | patches = [ ./remove-werror.patch ]; # Build fails with -Werror 36 | 37 | meta = with lib; { 38 | description = "Takes text from standard input and outputs it to a desktop-widget on Wayland desktops."; 39 | homepage = "https://git.sr.ht/~proycon/wayout"; 40 | license = licenses.gpl3; 41 | platforms = platforms.linux; 42 | maintainers = with maintainers; [ wentam ]; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /pkgs/codemadness-frontends/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, lib, fetchurl, libressl, glibc, ... }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "codemadness-frontends"; 5 | version = "0.5"; 6 | 7 | patches = [ ./001-link-dynamically.patch ]; 8 | 9 | buildInputs = [ libressl glibc ]; 10 | 11 | makeFlags = [ "RANLIB=${stdenv.cc.targetPrefix}ranlib" ]; 12 | 13 | src = fetchurl { 14 | url = "https://www.codemadness.org/releases/frontends/frontends-${version}.tar.gz"; 15 | sha256 = "sha256-8NKSfyIMSzaWTgIkFdcPTX/ECeQiasZPfZG1Ft/LOUw="; 16 | }; 17 | 18 | installPhase = '' 19 | install -D reddit/cli $out/bin/reddit-cli 20 | install -D reddit/gopher $out/bin/reddit-gopher 21 | install -D duckduckgo/cli $out/bin/duckduckgo-cli 22 | install -D duckduckgo/gopher $out/bin/duckduckgo-gopher 23 | install -D youtube/cli $out/bin/youtube-cli 24 | install -D youtube/cgi $out/bin/youtube-cgi 25 | install -D youtube/gopher $out/bin/youtube-gopher 26 | ''; 27 | 28 | meta = with lib; { 29 | description = "Frontends for duckduckgo, reddit, twitch, and youtube"; 30 | homepage = "https://www.codemadness.org/"; 31 | license = licenses.isc; 32 | platforms = platforms.linux; 33 | maintainers = with maintainers; [ wentam ]; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/mmsd-tng/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | stdenv, 3 | lib, 4 | fetchFromGitLab, 5 | meson, 6 | ninja, 7 | mobile-broadband-provider-info, 8 | pkg-config, 9 | glib, 10 | modemmanager, 11 | libsoup, 12 | c-ares, 13 | libphonenumber, 14 | protobuf, 15 | dbus, 16 | json_c, 17 | ... 18 | }: 19 | 20 | stdenv.mkDerivation rec { 21 | pname = "mmsd-tng"; 22 | version = "1.9"; 23 | 24 | src = fetchFromGitLab { 25 | owner = "kop316"; 26 | repo = "mmsd"; 27 | rev = version; 28 | sha256 = "sha256-IK3MU/sKHQLoCvnzjm1cyk3Gv00VKL04gTlN8hzxXNA="; 29 | }; 30 | 31 | nativeBuildInputs = [ meson pkg-config ninja ]; 32 | buildInputs = [ mobile-broadband-provider-info glib modemmanager libsoup c-ares libphonenumber protobuf dbus json_c ]; 33 | 34 | configurePhase = '' 35 | meson _build -Dbuild-mmsctl=true 36 | ''; 37 | 38 | buildPhase = '' 39 | meson compile -C _build 40 | ''; 41 | 42 | installPhase = '' 43 | mkdir -p $out/bin 44 | install _build/mmsdtng $out/bin/ 45 | install _build/tools/create-hex-array $out/bin/ 46 | install _build/tools/decode-mms $out/bin/ 47 | install _build/tools/mmsctl $out/bin/ 48 | ''; 49 | 50 | meta = with lib; { 51 | description = "Multimedia Messaging Service Daemon - The Next Generation"; 52 | homepage = "https://gitlab.com/kop316/mmsd/"; 53 | license = licenses.gpl2; 54 | platforms = platforms.linux; 55 | maintainers = with maintainers; [ wentam ]; 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sxmo-nix 2 | 3 | Packaging Sxmo/Swmo for NixOS with a goal of upstreaming to nixpkgs. 4 | 5 | See also: 6 | * https://git.sr.ht/~noneucat/nur-packages 7 | * https://github.com/chuangzhu/nixpkgs-sxmo 8 | 9 | # Usage 10 | 11 | ```nix 12 | { 13 | imports = [ 14 | ./sxmo-nix/modules/sxmo/sxmo.nix # 15 | ./sxmo-nix/modules/tinydm # Or wherever they're located 16 | ]; 17 | 18 | services.xserver = { 19 | enable = true; 20 | desktopManager.sxmo.enable = true; 21 | 22 | displayManager = { 23 | tinydm.enable = true; # power->toggle WM in sxmo only works with tinytm 24 | autoLogin.enable = true; 25 | autoLogin.user = "[your_user]"; 26 | defaultSession = "swmo"; # Or sxmo for X session 27 | }; 28 | }; 29 | } 30 | ``` 31 | 32 | # Notes 33 | * You must use tinydm if you want menu->power->toggle WM to work. It may be worth looking into providing alternative hooks for other DMS later on though! 34 | * Your user must be in group 'wheel' for sxmo's power off, wifi toggle, bluetooth toggle, modem toggle fetaures to work 35 | * If sxmo doesn't have a profile for your device, you'll need to [patch one in.](https://git.sr.ht/~mil/sxmo-utils/tree/master/item/scripts/deviceprofiles) Also consider upstreaming to sxmo! 36 | 37 | # Debugging tips 38 | * If you're using tinydm, ~/.local/state/tinydm.log contains sxmo's output 39 | 40 | # Donations 41 | Much of my time is volunteered towards open-source projects to improve the free software ecosystem 42 | for all. 43 | 44 | [You can support my work here](https://liberapay.com/wentam) :+1:. 45 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/007-xdg-data-path.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configs/appcfg/profile_template b/configs/appcfg/profile_template 2 | index be2b579..b34ba76 100644 3 | --- a/configs/appcfg/profile_template 4 | +++ b/configs/appcfg/profile_template 5 | @@ -1,5 +1,8 @@ 6 | #!/bin/sh 7 | 8 | +# shellcheck source=scripts/core/sxmo_common.sh 9 | +. sxmo_common.sh 10 | + 11 | # Please modify this file to your liking 12 | 13 | # Important Instructions: 14 | @@ -31,7 +34,7 @@ command -v firefox >/dev/null && export BROWSER=firefox 15 | #export DMENU_WRAP_AROUND=1 16 | 17 | # Enable audio feedback on keypress 18 | -#export KEYBOARD_ARGS="-o | clickclack -f /usr/share/sxmo/keytap.wav" 19 | +#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)" 20 | 21 | # Or, enable vibration feedback on keypress 22 | #export KEYBOARD_ARGS="-o | clickclack -V" 23 | @@ -48,10 +51,10 @@ case "$SXMO_WM" in 24 | esac 25 | 26 | #Set RINGTONE to audio file to play for incoming call 27 | -export SXMO_RINGTONE="/usr/share/sxmo/ring.ogg" 28 | +export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)" 29 | 30 | #Set TEXTSOUND to audio file to play when received text message 31 | -export SXMO_TEXTSOUND="/usr/share/sxmo/notify.ogg" 32 | +export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)" 33 | 34 | #Set RINGTIME to number of seconds the phone will ring 35 | export SXMO_RINGTIME=20 36 | diff --git a/configs/default_hooks/sxmo_hook_contextmenu.sh b/configs/default_hooks/sxmo_hook_contextmenu.sh 37 | index 1e8676e..1fd7ad7 100644 38 | --- a/configs/default_hooks/sxmo_hook_contextmenu.sh 39 | +++ b/configs/default_hooks/sxmo_hook_contextmenu.sh 40 | @@ -124,8 +124,8 @@ case "$WMCLASS" in 41 | $icon_lck Lock (Screen off) ^ 0 ^ sxmo_hook_screenoff.sh 42 | $icon_zzz Suspend ^ 0 ^ sxmo_hook_screenoff.sh && sxmo_suspend.sh 43 | $icon_out Logout ^ 0 ^ confirm Logout && (pkill dwm || swaymsg exit) 44 | - $([ -f /usr/share/xsessions/sxmo.desktop ] && 45 | - [ -f /usr/share/wayland-sessions/swmo.desktop ] && 46 | + $([ -f "$(xdg_data_path xsessions/sxmo.desktop)" ] && 47 | + [ -f "$(xdg_data_path wayland-sessions/swmo.desktop)" ] && 48 | echo "$icon_rol Toggle WM ^ 0 ^ confirm Toggle && sxmo_wmtoggle.sh" 49 | ) 50 | $icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot 51 | -------------------------------------------------------------------------------- /pkgs/tinydm/001-use-xdg-data-dirs.patch: -------------------------------------------------------------------------------- 1 | diff --git a/tinydm-run-session.sh b/tinydm-run-session.sh 2 | index 5f4eb69..c474316 100644 3 | --- a/tinydm-run-session.sh 4 | +++ b/tinydm-run-session.sh 5 | @@ -1,6 +1,10 @@ 6 | #!/bin/sh 7 | # Copyright 2020 Oliver Smith 8 | # SPDX-License-Identifier: GPL-3.0-or-later 9 | +# 10 | +# Patched version of tinyDM to allow path configuration, the following can be optionally set: 11 | +# TINYDM_X11_PROFILE_PATH - path of profiles to be sourced on startup 12 | +# TINYDM_WAYLAND_PROFILE_PATH - path of profiles to be sourced on startup 13 | 14 | setup_log() { 15 | logfile=${XDG_STATE_HOME:-~/.local/state}/tinydm.log 16 | @@ -30,15 +34,22 @@ source_session_profiles() { 17 | exit 1 18 | fi 19 | 20 | - for file in "/etc/tinydm.d/env-${session_type}.d/"*; do 21 | - if ! [ -e "$file" ]; then 22 | - continue 23 | - fi 24 | - 25 | - echo "tinydm: sourcing file: $file" 26 | - # shellcheck disable=SC1090 27 | - . "$file" 28 | - done 29 | + profile_path=$TINYDM_X11_PROFILE_PATH 30 | + if [ "$session_type" == "wayland"]; then 31 | + profile_path=$TINYDM_WAYLAND_PROFILE_PATH 32 | + fi 33 | + 34 | + if [ ! -z $profile_path ]; then 35 | + for file in "${profile_path}"*; do 36 | + if ! [ -e "$file" ]; then 37 | + continue 38 | + fi 39 | + 40 | + echo "tinydm: sourcing file: $file" 41 | + # shellcheck disable=SC1090 42 | + . "$file" 43 | + done 44 | + fi 45 | } 46 | 47 | 48 | @@ -98,22 +109,33 @@ run_session() { 49 | echo "Exec: $cmd" 50 | echo "---" 51 | 52 | - case "$resolved" in 53 | - /usr/share/wayland-sessions*) 54 | - source_session_profiles wayland 55 | - # shellcheck disable=SC2086 56 | - run_session_wayland $cmd 57 | - ;; 58 | - /usr/share/xsessions*) 59 | - source_session_profiles x11 60 | - # shellcheck disable=SC2086 61 | - run_session_x $cmd 62 | - ;; 63 | - *) 64 | - echo "ERROR: could not detect session type!" 65 | - exit 1 66 | - ;; 67 | - esac 68 | + IFS=$'\n: ' 69 | + for dir in $XDG_DATA_DIRS 70 | + do 71 | + xsessions=$(realpath ${dir}/xsessions/* 2>/dev/null) 72 | + wsessions=$(realpath ${dir}/wayland-sessions/* 2>/dev/null) 73 | + for session in ${wsessions} 74 | + do 75 | + if [ "$resolved" = "$session" ]; then 76 | + echo "tinydm: running wayland session ${session} (${cmd})" 77 | + source_session_profiles wayland 78 | + # shellcheck disable=SC2086 79 | + run_session_wayland $cmd 80 | + break 81 | + fi 82 | + done 83 | + 84 | + for session in ${xsessions} 85 | + do 86 | + if [ "$resolved" = "$session" ]; then 87 | + echo "tinydm: running xorg session ${session} (${cmd})" 88 | + source_session_profiles x11 89 | + # shellcheck disable=SC2086 90 | + run_session_x $cmd 91 | + break 92 | + fi 93 | + done 94 | + done 95 | } 96 | 97 | setup_log 98 | -------------------------------------------------------------------------------- /modules/sxmo/default.nix: -------------------------------------------------------------------------------- 1 | {config, options, lib, pkgs, ...}: 2 | 3 | let 4 | sxmopkgs = import ../../default.nix { inherit pkgs; }; 5 | dmcfg = config.services.xserver.desktopManager; 6 | in 7 | { 8 | options = { 9 | services.xserver.desktopManager.sxmo = { 10 | enable = lib.mkOption { 11 | type = lib.types.bool; 12 | default = false; 13 | description = ""; 14 | }; 15 | }; 16 | services.xserver.desktopManager.sxmo.package = lib.mkOption { 17 | type = lib.types.package; 18 | default = sxmopkgs.sxmo-utils; 19 | description = "sxmo-utils package to use"; 20 | }; 21 | }; 22 | 23 | config = lib.mkIf config.services.xserver.desktopManager.sxmo.enable { 24 | environment.systemPackages = [ dmcfg.sxmo.package sxmopkgs.superd ]; 25 | 26 | services.udev.packages = [ dmcfg.sxmo.package ]; # Install udev rules 27 | fonts.fonts = [ pkgs.nerdfonts ]; # Sxmo uses nerdfonts for it's icons 28 | powerManagement.enable = lib.mkDefault true; # For suspend 29 | services.xserver.libinput.enable = lib.mkDefault true; 30 | 31 | # Needed for sxmo to find it's hooks/superd services, and for the user's 32 | # local sxmo configuration to reference resources without needing to migrate 33 | # for every single nix store path change. 34 | environment.pathsToLink = [ "/share" ]; 35 | 36 | services.xserver.displayManager.sessionPackages = [ dmcfg.sxmo.package ]; 37 | 38 | # Power button shouldn't immediately power off the device 39 | # (sxmo uses it for menus etc) 40 | services.logind.extraConfig = lib.mkDefault '' 41 | HandlePowerKey=ignore 42 | ''; 43 | 44 | # Sxmo uses doas to run these commands as root. We need to allow that. 45 | # sxmo-utils provides this config, but we shouldn't ask the application 46 | # what the application is permitted to run as root :) 47 | # 48 | # As such, we maintain it here. 49 | # 50 | # Note: this allows *any wheel user* to run the commands prefixed with 'nopass' here 51 | # as root without a password. This isn't too bad, because generally it's intended 52 | # that wheel users have access to the root account in some way. 53 | security.doas.enable = true; 54 | security.doas.extraConfig = '' 55 | permit persist :wheel 56 | permit nopass :wheel as root cmd busybox args poweroff 57 | permit nopass :wheel as root cmd busybox args reboot 58 | permit nopass :wheel as root cmd poweroff 59 | permit nopass :wheel as root cmd systemctl args poweroff 60 | permit nopass :wheel as root cmd rtcwake 61 | permit nopass :wheel as root cmd reboot 62 | permit nopass :wheel as root cmd sxmo_wifitoggle.sh 63 | permit nopass :wheel as root cmd sxmo_bluetoothtoggle.sh 64 | permit nopass :wheel as root cmd systemctl args restart bluetooth 65 | permit nopass :wheel as root cmd tinydm-set-session 66 | permit nopass :wheel as root cmd systemctl args start eg25-manager 67 | permit nopass :wheel as root cmd systemctl args stop eg25-manager 68 | permit nopass :wheel as root cmd systemctl args start ModemManager 69 | permit nopass :wheel as root cmd systemctl args stop ModemManager 70 | permit setenv { NIX_PATH } :wheel as root cmd nohup args nixos-rebuild switch --upgrade 71 | ''; 72 | 73 | # Sxmo uses rtcwake to suspend the system, we need 74 | # setuid to give it access 75 | security.wrappers."rtcwake" = { 76 | setuid = true; 77 | source = "${pkgs.util-linux}/bin/rtcwake"; 78 | owner = "root"; 79 | group = "wheel"; 80 | }; 81 | }; 82 | } 83 | -------------------------------------------------------------------------------- /modules/tinydm/default.nix: -------------------------------------------------------------------------------- 1 | {config, options, lib, pkgs, ...}: 2 | 3 | with lib; 4 | 5 | let 6 | sxmopkgs = import ../../default.nix { inherit pkgs; }; 7 | dmcfg = config.services.xserver.displayManager; 8 | xsession_path = "${dmcfg.sessionData.desktops}/share/xsessions/"; 9 | wsession_path = "${dmcfg.sessionData.desktops}/share/wayland-sessions/"; 10 | in 11 | { 12 | imports = [ 13 | ../autologin 14 | ]; 15 | options = { 16 | services.xserver.displayManager.tinydm = { 17 | enable = lib.mkOption { 18 | type = lib.types.bool; 19 | default = false; 20 | description = ""; 21 | }; 22 | }; 23 | }; 24 | 25 | config = lib.mkIf config.services.xserver.displayManager.tinydm.enable { 26 | assertions = [ 27 | { 28 | assertion = config.services.xserver.enable; 29 | message = '' 30 | TinyDM requires services.xserver.enable to be true. 31 | ''; 32 | } 33 | { 34 | assertion = dmcfg.autoLogin.enable; 35 | message = '' 36 | TinyDM requires services.xserver.displayManager.autoLogin.enable to be true. 37 | ''; 38 | } 39 | { 40 | assertion = dmcfg.autoLogin.enable -> dmcfg.sessionData.autologinSession != null; 41 | message = '' 42 | TinyDM auto-login requires services.xserver.displayManager.defaultSession to be set. 43 | ''; 44 | } 45 | ]; 46 | 47 | # TODO nixpkgs/nixos/modules/services/x11/xserver.nix turns this off if we're not a recognized DM 48 | # (this is so that startx etc can work manually). 49 | # 50 | # It will also default us to lightdm because we are not recognized 51 | # 52 | # If upstreaming, update xserver.nix and remove these. 53 | systemd.services.display-manager.enable = true; 54 | services.xserver.displayManager.lightdm.enable = false; 55 | 56 | programs.autologin.enable = true; 57 | 58 | environment.systemPackages = [ sxmopkgs.tinydm ]; 59 | 60 | # Oneshot service that clears our session on boot and nixos-rebuild such that the next service 61 | # start runs the default session 62 | # 63 | # Tinydm users can change their session with tinydm-set-session, so we don't want to force the default 64 | # on every DM start (sxmo uses this, for example.) 65 | # 66 | # If the user has not yet defined a service, DM start will still write the default without a reboot. 67 | systemd.services.tinydm-setup = { 68 | description = "Tinydm setup"; 69 | wantedBy = [ "multi-user.target" ]; 70 | 71 | serviceConfig = { 72 | Type = "oneshot"; 73 | StateDirectory = "/var/lib/tinydm/"; 74 | User = "root"; 75 | Group = "root"; 76 | ExecStart = ''${pkgs.busybox}/bin/rm -f /var/lib/tinydm/default-session.desktop''; 77 | }; 78 | }; 79 | 80 | # Set default session on DM start if we don't have a session defined 81 | services.xserver.displayManager.job.preStart = '' 82 | if [ ! -e /var/lib/tinydm/default-session.desktop ]; then 83 | if [ -e ${xsession_path}/${dmcfg.defaultSession}.desktop ]; then 84 | ${sxmopkgs.tinydm}/bin/tinydm-set-session -f -s ${xsession_path}/${dmcfg.defaultSession}.desktop 85 | fi 86 | 87 | if [ -e ${wsession_path}/${dmcfg.defaultSession}.desktop ]; then 88 | ${sxmopkgs.tinydm}/bin/tinydm-set-session -f -s ${wsession_path}/${dmcfg.defaultSession}.desktop 89 | fi 90 | fi 91 | ''; 92 | 93 | # tinydm uses startx for X sessions 94 | services.xserver.displayManager.startx.enable = true; 95 | 96 | systemd.services.display-manager.after = [ "getty@tty1.service" "systemd-user-sessions.service" ]; 97 | systemd.services.display-manager.conflicts = [ "getty@tty1.service" ]; 98 | 99 | # More durable service restarting (sxmo toggle WM feature breaks without this) 100 | systemd.services.display-manager.serviceConfig.RestartSec = lib.mkOverride 10 3; 101 | 102 | services.xserver.displayManager.job.execCmd = '' 103 | exec ${sxmopkgs.autologin}/bin/autologin ${dmcfg.autoLogin.user} ${sxmopkgs.tinydm}/bin/tinydm-run-session 104 | ''; 105 | }; 106 | } 107 | -------------------------------------------------------------------------------- /pkgs/sxmo-utils/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv 2 | , pkgs 3 | , lib 4 | , fetchFromSourcehut 5 | , coreutils 6 | , findutils 7 | , gnused 8 | , gnugrep 9 | , busybox 10 | , libnotify 11 | , inotify-tools 12 | , xdg-user-dirs 13 | , mmsd-tng 14 | , alsa-utils 15 | , callaudiod 16 | , light 17 | , superd 18 | , lisgd 19 | , pn 20 | , gojq 21 | , mnc 22 | , lsof 23 | , bc 24 | , dbus 25 | , file 26 | , curl 27 | , vvmd 28 | , mpv 29 | , pamixer 30 | , codemadness-frontends 31 | , sfeed 32 | , libxml2 33 | , youtube-dl 34 | , sxiv 35 | , mediainfo 36 | , gawk 37 | , modemmanager 38 | , util-linux 39 | , proycon-wayout 40 | , autocutsel 41 | , sxmo-dwm 42 | , sxmo-dmenu 43 | , svkbd 44 | , xdotool 45 | , xprintidle 46 | , conky 47 | , clickclack 48 | , xmodmap 49 | , feh 50 | , unclutter-xfixes 51 | , dunst 52 | , gnome-icon-theme 53 | , sxmo-st 54 | , xsel 55 | , xclip 56 | , scrot 57 | , sway 58 | , bemenu 59 | , wvkbd 60 | , swayidle 61 | , wob 62 | , mako 63 | , foot 64 | , grim 65 | , slurp 66 | , x11Support ? true 67 | , waylandSupport ? true 68 | , ... 69 | }: 70 | 71 | stdenv.mkDerivation rec { 72 | pname = "sxmo-utils"; 73 | 74 | # Important: When updating version, grep for /usr/share in sxmo-utils. All instances should be 75 | # replaced with uses of the xdg_data_path function in sxmo_common.sh, and the devs often forget 76 | # this. Use your patch here, but also submit your patch to sxmo-utils. 77 | version = "1.12.0"; 78 | 79 | src = fetchFromSourcehut { 80 | owner = "~mil"; 81 | repo = "sxmo-utils"; 82 | rev = version; 83 | sha256 = "sha256-JoOJyoVpSK1iDekaRvltVT6AEi87ZSUDaCidF5tYXlI="; 84 | }; 85 | 86 | patches = [ 87 | ./001-fix-makefile-appscript-symlinks.patch 88 | ./003-repoint-config-paths.patch # Configs can reference data through /run/current-system/sw/share/ 89 | ./006-system-manages-pipewire.patch # Sxmo trying to manage pipewire conflicts with system. 90 | ]; 91 | 92 | passthru.providedSessions = lib.optionals x11Support [ "sxmo" ] 93 | ++ lib.optionals waylandSupport [ "swmo" ]; 94 | 95 | nativeBuildInputs = [ coreutils findutils gnused busybox ]; 96 | 97 | makeFlags = [ 98 | "DESTDIR=$(out)" 99 | "PREFIX=" 100 | "OPENRC=0" 101 | ]; 102 | 103 | postInstall = '' 104 | mkdir -p $out/lib/udev 105 | mv $out/usr/lib/udev/rules.d $out/lib/udev/ 106 | cd $out && rmdir -p usr/lib/udev/ 107 | ''; 108 | 109 | postPatch = '' 110 | # Sxmo references /usr/bin/ directly in a number of places. We can just 111 | # chop it off and everything will be found via $PATH 112 | find . -type f -exec sed -E -i "s|/usr/bin/||g" {} + 113 | 114 | substituteInPlace configs/udev/90-sxmo.rules \ 115 | --replace /bin/chgrp ${coreutils}/bin/chgrp \ 116 | --replace /bin/chmod ${coreutils}/bin/chmod 117 | 118 | # We'll be wrapping the sxmo scripts by modifying sxmo_common.sh. 119 | # Make sure sxmo_common.sh is sourced everywhere so this is consistently applied 120 | sed -i '2i . sxmo_common.sh' \ 121 | $(${gnugrep}/bin/grep -rL "\. sxmo_common.sh" --include \*.sh --exclude sxmo_common.sh .) 122 | 123 | # Script dependencies 124 | sed -i '2i export PATH="'"$out"'/bin:${lib.makeBinPath ([ 125 | libnotify # For sending desktop notifications 126 | inotify-tools 127 | xdg-user-dirs # For xdg-user-dirs-update 128 | modemmanager 129 | mmsd-tng # MMS support 130 | alsa-utils 131 | callaudiod # Call audio routing 132 | light # Used to adjust backlight 133 | superd # Manages sxmo's services 134 | util-linux # setsid, rfkill 135 | busybox # Sxmo sometimes uses busybox binary directly 136 | lisgd # Gesture daemon 137 | pn # Phone number parsing/formatting/validation 138 | gojq # JSON parsing 139 | mnc # Used to schedule suspend wakeups for cron 140 | lsof 141 | bc 142 | dbus # dbus-run-session 143 | file 144 | curl 145 | vvmd # Visual voicemail 146 | mpv 147 | pamixer # Volume control when using pulse/pipewire 148 | codemadness-frontends # reddit-cli and youtube-cli for sxmo_[reddit|youtube].sh 149 | sfeed # sxmo_rss.sh 150 | libxml2 # sxmo_weather.sh 151 | youtube-dl # sxmo_youtube.sh 152 | sxiv # To view images with file browser and sxmo_open.sh 153 | mediainfo # sxmo_record.sh 154 | gawk 155 | ] ++ lib.optionals x11Support [ 156 | autocutsel # sxmo runs this to keep the cutbuffer and clipboard in sync 157 | sxmo-dwm 158 | sxmo-dmenu 159 | svkbd 160 | xdotool 161 | xprintidle 162 | conky # Used for clock 163 | clickclack # for keyboard feedback 164 | xmodmap 165 | feh 166 | unclutter-xfixes 167 | dunst 168 | gnome-icon-theme # dunst needs these 169 | sxmo-st 170 | xsel 171 | xclip 172 | scrot 173 | ] ++ lib.optionals waylandSupport [ 174 | (sway.override { 175 | withBaseWrapper = true; 176 | withGtkWrapper = true; 177 | }) 178 | bemenu 179 | wvkbd 180 | swayidle 181 | wob 182 | mako 183 | proycon-wayout 184 | foot 185 | 186 | # scripts 187 | grim 188 | slurp 189 | ])}''${PATH:+:}$PATH"' scripts/core/sxmo_common.sh 190 | 191 | sed -i '2i export PATH="\$XDG_BIN_HOME:\$XDG_CONFIG_HOME/sxmo/hooks/:'"$out"'/share/sxmo/default_hooks/''${PATH:+:}$PATH"' \ 192 | scripts/core/sxmo_common.sh 193 | 194 | # Need environment variables to run sxmo script over ssh/without graphical session 195 | sed -i '2i export XDG_DATA_DIRS="'"$out"'/share''${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"' \ 196 | scripts/core/sxmo_common.sh 197 | 198 | # These need to be set for some scripts to work over ssh/outside of graphical session. 199 | # Should match the values in sxmo_init.sh 200 | sed -i '2i export XDG_CONFIG_HOME="''${XDG_CONFIG_HOME:-$HOME/.config}"' \ 201 | scripts/core/sxmo_common.sh 202 | sed -i '2i export XDG_DATA_HOME="''${XDG_DATA_HOME:-$HOME/.local/share}"' \ 203 | scripts/core/sxmo_common.sh 204 | sed -i '2i export XDG_CACHE_HOME="''${XDG_CACHE_HOME:-$HOME/.cache}"' \ 205 | scripts/core/sxmo_common.sh 206 | 207 | # Sometimes sxmo assumes certain non-standard features in common utilities. 208 | # Explicitly define these cases with aliases to ensure the relevant features are present. 209 | ${if waylandSupport then 210 | '' 211 | sed -i '2i alias wayout="${proycon-wayout}/bin/proycon-wayout"' \ 212 | scripts/core/sxmo_common.sh 213 | '' 214 | else "" 215 | } 216 | sed -i '2i alias realpath="${coreutils}/bin/realpath"' \ 217 | scripts/core/sxmo_common.sh 218 | sed -i '2i alias stat="${coreutils}/bin/stat"' \ 219 | scripts/core/sxmo_common.sh 220 | sed -i '2i alias mktemp="${coreutils}/bin/mktemp"' \ 221 | scripts/core/sxmo_common.sh 222 | sed -i '2i alias date="${coreutils}/bin/date"' \ 223 | scripts/core/sxmo_common.sh 224 | sed -i 's|alias rfkill=.*$||' scripts/core/sxmo_common.sh 225 | sed -i '2i alias rfkill="${util-linux}/bin/rfkill"' \ 226 | scripts/core/sxmo_common.sh 227 | 228 | # Make poweroff work 229 | substituteInPlace scripts/core/sxmo_power.sh \ 230 | --replace "doas poweroff" "doas systemctl poweroff" 231 | 232 | # rtcwake needs elevated permissions, use doas rather than setuid to avoid the need to reference 233 | # the NixOS-only /run/wrappers/bin path. 234 | substituteInPlace configs/default_hooks/sxmo_hook_suspend.sh \ 235 | --replace "rtcwake" "doas rtcwake" 236 | 237 | # sxmo hardcodes path to sxmo_init.sh, repoint 238 | substituteInPlace \ 239 | scripts/core/sxmo_winit.sh \ 240 | scripts/core/sxmo_xinit.sh \ 241 | scripts/core/sxmo_rtcwake.sh \ 242 | scripts/core/sxmo_migrate.sh \ 243 | --replace "/etc/profile.d/sxmo_init.sh" "$out/etc/profile.d/sxmo_init.sh" 244 | ''; 245 | 246 | meta = with lib; { 247 | description = "Contains the scripts and small C programs that glues the sxmo enviroment together"; 248 | homepage = "https://git.sr.ht/~mil/sxmo-utils"; 249 | license = licenses.agpl3Only; 250 | platforms = platforms.linux; 251 | maintainers = with maintainers; [ wentam ]; 252 | }; 253 | } 254 | --------------------------------------------------------------------------------