Skip to content
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

tuxedo-rs: init at 0.2.2 #231384

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2311.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions nixos/modules/services/hardware/tuxedo-rs.nix
Original file line number Diff line number Diff line change
@@ -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 ];
}
60 changes: 60 additions & 0 deletions pkgs/os-specific/linux/tailor-gui/default.nix
Original file line number Diff line number Diff line change
@@ -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
mrcjkb marked this conversation as resolved.
Show resolved Hide resolved
];

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;
};
}
47 changes: 47 additions & 0 deletions pkgs/os-specific/linux/tuxedo-rs/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}

4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down Expand Up @@ -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;
Expand Down