From 95946586fbff9e5ac037170f42b5de2fa392c062 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 12 May 2023 01:42:20 +0200 Subject: [PATCH 1/3] maintainers: add mrcjkb --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 92c856ea5d68..89442bbd33de 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -11835,6 +11835,13 @@ githubId = 2072185; name = "Marc Scholten"; }; + mrcjkb = { + email = "marc@jakobi.dev"; + matrix = "@mrcjk:matrix.org"; + name = "Marc Jakobi"; + github = "mrcjkb"; + githubId = 12857160; + }; mredaelli = { email = "massimo@typish.io"; github = "mredaelli"; From c9e2bc6920c01684b3fd4a7724716ba730bfa903 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 26 Sep 2023 23:26:47 +0200 Subject: [PATCH 2/3] tuxedo-rs: init at 0.2.2 --- pkgs/os-specific/linux/tailor-gui/default.nix | 60 +++++++++++++++++++ pkgs/os-specific/linux/tuxedo-rs/default.nix | 47 +++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 111 insertions(+) create mode 100644 pkgs/os-specific/linux/tailor-gui/default.nix create mode 100644 pkgs/os-specific/linux/tuxedo-rs/default.nix diff --git a/pkgs/os-specific/linux/tailor-gui/default.nix b/pkgs/os-specific/linux/tailor-gui/default.nix new file mode 100644 index 000000000000..86964ab4d36a --- /dev/null +++ b/pkgs/os-specific/linux/tailor-gui/default.nix @@ -0,0 +1,60 @@ +{ stdenv +, lib +, rustPlatform +, cargo +, rustc +, pkg-config +, desktop-file-utils +, appstream-glib +, wrapGAppsHook4 +, meson +, ninja +, libadwaita +, gtk4 +, tuxedo-rs +}: +let + src = tuxedo-rs.src; + sourceRoot = "source/tailor_gui"; + pname = "tailor_gui"; + version = tuxedo-rs.version; +in +stdenv.mkDerivation { + + inherit src sourceRoot pname version; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src sourceRoot; + name = "${pname}-${version}"; + hash = "sha256-DUaSLv1V6skWXQ7aqD62uspq+I9KiWmjlwwxykVve5A="; + }; + + nativeBuildInputs = [ + rustPlatform.cargoSetupHook + pkg-config + desktop-file-utils + appstream-glib + wrapGAppsHook4 + ]; + + buildInputs = [ + cargo + rustc + meson + ninja + libadwaita + gtk4 + ]; + + meta = with lib; { + description = "Rust GUI for interacting with hardware from TUXEDO Computers"; + longDescription = '' + An alternative to the TUXEDO Control Center (https://www.tuxedocomputers.com/en/TUXEDO-Control-Center.tuxedo), + written in Rust. + ''; + homepage = "https://github.com/AaronErhardt/tuxedo-rs"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ mrcjkb ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/tuxedo-rs/default.nix b/pkgs/os-specific/linux/tuxedo-rs/default.nix new file mode 100644 index 000000000000..c9fb057da68b --- /dev/null +++ b/pkgs/os-specific/linux/tuxedo-rs/default.nix @@ -0,0 +1,47 @@ +{ lib +, fetchFromGitHub +, rustPlatform +}: +let + + # NOTE: This src is shared with tailor-gui. + # When updating, the tailor-gui.cargoDeps hash needs to be updated. + src = fetchFromGitHub { + owner = "AaronErhardt"; + repo = "tuxedo-rs"; + rev = "a77a9f6c64e6dd1ede3511934392cbc16271ef6b"; + hash = "sha256-bk17vI1gLHayvCWfmZdCMqgmbJFOTDaaCaHcj9cLpMY="; + }; + +in +rustPlatform.buildRustPackage { + pname = "tuxedo-rs"; + version = "0.2.2"; + + inherit src; + + # Some of the tests are impure and rely on files in /etc/tailord + doCheck = false; + + cargoHash = "sha256-vuXqab9W8NSD5U9dk15xM4fM/vd/fGgGdsvReMncWHg="; + + postInstall = '' + install -Dm444 tailord/com.tux.Tailor.conf -t $out/share/dbus-1/system.d + ''; + + meta = with lib; { + description = "Rust utilities for interacting with hardware from TUXEDO Computers"; + longDescription = '' + An alternative to the TUXEDO Control Center daemon. + + Contains the following binaries: + - tailord: Daemon handling fan, keyboard and general HW support for Tuxedo laptops + - tailor: CLI + ''; + homepage = "https://github.com/AaronErhardt/tuxedo-rs"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ mrcjkb ]; + platforms = platforms.linux; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4775683e3a6c..0c995a9173bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35862,6 +35862,8 @@ with pkgs; tailor = callPackage ../applications/version-management/tailor { }; + tailor-gui = callPackage ../os-specific/linux/tailor-gui { }; + taizen = callPackage ../applications/misc/taizen { }; talosctl = callPackage ../applications/networking/cluster/talosctl { }; @@ -36192,6 +36194,8 @@ with pkgs; tut = callPackage ../applications/misc/tut { }; + tuxedo-rs = callPackage ../os-specific/linux/tuxedo-rs { }; + tuxguitar = callPackage ../applications/editors/music/tuxguitar { jre = jre8; swt = swt_jdk8; From 01cc0a605a03e0d6ad0b3482c964a67c3fdff01d Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 26 Sep 2023 23:27:22 +0200 Subject: [PATCH 3/3] nixos/tuxedo-rs: init at 0.2.2 --- .../manual/release-notes/rl-2311.section.md | 2 + nixos/modules/module-list.nix | 1 + nixos/modules/services/hardware/tuxedo-rs.nix | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 nixos/modules/services/hardware/tuxedo-rs.nix diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index cdb73fb49fa8..5a955a209e0e 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -80,6 +80,8 @@ - [NNCP](http://www.nncpgo.org/). Added nncp-daemon and nncp-caller services. Configuration is set with [programs.nncp.settings](#opt-programs.nncp.settings) and the daemons are enabled at [services.nncp](#opt-services.nncp.caller.enable). +- [tuxedo-rs](https://github.com/AaronErhardt/tuxedo-rs), Rust utilities for interacting with hardware from TUXEDO Computers. + ## Backward Incompatibilities {#sec-release-23.11-incompatibilities} - The `boot.loader.raspberryPi` options have been marked deprecated, with intent for removal for NixOS 24.11. They had a limited use-case, and do not work like people expect. They required either very old installs ([before mid-2019](https://github.com/NixOS/nixpkgs/pull/62462)) or customized builds out of scope of the standard and generic AArch64 support. That option set never supported the Raspberry Pi 4 family of devices. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 54fd5c7b0403..cbd5e6467f82 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -541,6 +541,7 @@ ./services/hardware/tlp.nix ./services/hardware/trezord.nix ./services/hardware/triggerhappy.nix + ./services/hardware/tuxedo-rs.nix ./services/hardware/udev.nix ./services/hardware/udisks2.nix ./services/hardware/undervolt.nix diff --git a/nixos/modules/services/hardware/tuxedo-rs.nix b/nixos/modules/services/hardware/tuxedo-rs.nix new file mode 100644 index 000000000000..343f6845fabb --- /dev/null +++ b/nixos/modules/services/hardware/tuxedo-rs.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.hardware.tuxedo-rs; + +in +{ + options = { + hardware.tuxedo-rs = { + enable = mkEnableOption (lib.mdDoc "Rust utilities for interacting with hardware from TUXEDO Computers."); + + tailor-gui.enable = mkEnableOption (lib.mdDoc "Alternative to TUXEDO Control Center, written in Rust."); + }; + }; + + config = mkIf cfg.enable (mkMerge [ + { + hardware.tuxedo-keyboard.enable = true; + + systemd = { + services.tailord = { + enable = true; + description = "Tuxedo Tailor hardware control service"; + after = [ "systemd-logind.service" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "dbus"; + BusName = "com.tux.Tailor"; + ExecStart = "${pkgs.tuxedo-rs}/bin/tailord"; + Environment = "RUST_BACKTRACE=1"; + Restart = "on-failure"; + }; + }; + }; + + services.dbus.packages = [ pkgs.tuxedo-rs ]; + + environment.systemPackages = [ pkgs.tuxedo-rs ]; + } + (mkIf cfg.tailor-gui.enable { + environment.systemPackages = [ pkgs.tailor-gui ]; + }) + ]); + + meta.maintainers = with maintainers; [ mrcjkb ]; +}