Skip to content

Commit 2ee81b3

Browse files
committed
Add rex
1 parent f584c20 commit 2ee81b3

7 files changed

Lines changed: 150 additions & 0 deletions

File tree

‎flake.lock‎

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@
103103
inputs.nixpkgs.follows = "nixpkgs";
104104
};
105105

106+
rex = {
107+
url = "https://pkgs.superlogical.com/rex/nix/stable.tar.gz";
108+
inputs.nixpkgs.follows = "nixpkgs";
109+
};
110+
106111
omarchy-el = {
107112
url = "github:ovistoica/omarchy.el";
108113
flake = false;

‎modules/base-host.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
self.nixosModules.home-manager
1717
self.nixosModules.nix-settings
1818
self.nixosModules.pki
19+
self.nixosModules.rex-server
1920
self.nixosModules.ssh
2021
self.nixosModules.syncthing
2122
self.nixosModules.tailscale

‎modules/darwin.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ in
2828
self.darwinModules.helium
2929
self.darwinModules.keepassxc
3030
self.darwinModules.nix-settings
31+
self.darwinModules.rex
3132
self.darwinModules.ssh
3233
self.darwinModules.tailscale
3334
];

‎modules/rex.nix‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{ inputs, self, ... }:
2+
{
3+
flake.darwinModules.rex =
4+
{ pkgs, ... }:
5+
{
6+
home-manager.sharedModules = [
7+
inputs.rex.homeManagerModules.default
8+
{
9+
programs.rex = {
10+
enable = true;
11+
package = self.packages.${pkgs.stdenv.hostPlatform.system}.rex-app;
12+
};
13+
}
14+
];
15+
16+
system.defaults.CustomUserPreferences."com.superlogical.rex" = {
17+
"Workspace.activePaneBorderColor" = "terminalForeground";
18+
"Workspace.activePaneBorderOpacity" = 0.2;
19+
"Workspace.activePaneBorderTransition" = "off";
20+
"Workspace.activityGrouping" = "priority";
21+
"Workspace.animationStyle" = "snappy";
22+
"Workspace.cursorShader" = "blazeNoTrail";
23+
"Workspace.cursorShadersEnabled" = true;
24+
"Workspace.focusFollowsMouse" = true;
25+
"Workspace.inactivePaneContentOpacity" = 0.9;
26+
"Workspace.inactivePaneSurfaceOpacity" = 0.9;
27+
"Workspace.interfaceStyle" = "useTheme";
28+
"Workspace.lightThemeID" = "merino-light";
29+
"Workspace.paneDensity" = "compact";
30+
"Workspace.paneHeaderVisibility" = "onHover";
31+
"Workspace.prefersSampledPaneRim" = true;
32+
"Workspace.shellIconTheme" = "default";
33+
"Workspace.showsActivePaneBorder" = true;
34+
"Workspace.showsPaneHeaders" = false;
35+
"Workspace.sidebarPosition" = "left";
36+
"Workspace.sidebarShowsActivity" = false;
37+
"Workspace.sidebarSwipe" = "swipe";
38+
"Workspace.sshAgentChoice" = "system";
39+
"Workspace.tabBarEdge" = "top";
40+
"Workspace.tabIconColorMode" = "always";
41+
"Workspace.tabIconCount" = 3;
42+
"Workspace.tabIconTintMode" = "off";
43+
"Workspace.tabStyle" = "horizontal";
44+
"Workspace.tabsFillAvailableSpace" = false;
45+
"Workspace.terminalCopyOnSelect" = true;
46+
"Workspace.terminalCursorBlinkIntervalMilliseconds" = 500;
47+
"Workspace.terminalCursorBlinkUsesCustomInterval" = false;
48+
"Workspace.terminalCursorStyle" = "block";
49+
"Workspace.terminalFontName" = "JetBrains Mono NL";
50+
"Workspace.terminalFontPointSize" = 15.0;
51+
"Workspace.terminalSelectionRoundedCorners" = true;
52+
"Workspace.terminalSmoothScrolling" = true;
53+
"Workspace.terminalStartupCommand" = "/run/current-system/sw/bin/nu --login";
54+
"Workspace.toolbarBehavior" = "alwaysShow";
55+
"Workspace.usesPaneGlass" = true;
56+
"rex.developer-mode-enabled" = false;
57+
"rex.server.automatic-restart-enabled" = true;
58+
"rex.server.block-plugin-reload-enabled" = false;
59+
"rex.server.run-mode" = "bundled";
60+
"rex.server.web-client-origin-patterns" = [ "https://rex.superlogical.com" ];
61+
};
62+
};
63+
64+
flake.nixosModules.rex-server = {
65+
home-manager.sharedModules = [
66+
inputs.rex.homeManagerModules.default
67+
{ services.rex.enable = true; }
68+
];
69+
};
70+
}

‎modules/user.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ in
99
{
1010
users.users.${id.userName} = {
1111
isNormalUser = true;
12+
linger = true;
1213
description = id.userName;
1314
# Lets a fresh install log in; `passwd` changes still persist
1415
initialHashedPassword = id.initialHashedPassword;

‎packages/rex-app.nix‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{ inputs, lib, ... }:
2+
{
3+
perSystem =
4+
{ pkgs, system, ... }:
5+
lib.optionalAttrs (system == "aarch64-darwin") {
6+
packages.rex-app = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
7+
pname = "rex-app";
8+
version = "1.0.0";
9+
build = "2275";
10+
11+
src = pkgs.fetchurl {
12+
url = "https://blob.superlogical.com/public/rex-app/stable-arm64/Rex-${finalAttrs.version}-${finalAttrs.build}.dmg";
13+
hash = "sha256-w0t06YzNvrMYlFU08jy0kzDZpFo+xNfl1x9dsSR5q2I=";
14+
};
15+
16+
nativeBuildInputs = [ pkgs._7zz ];
17+
# The image's /Applications link is absolute, which 7zz refuses to extract without -snld
18+
unpackPhase = ''
19+
runHook preUnpack
20+
7zz x -snld "$src"
21+
runHook postUnpack
22+
'';
23+
sourceRoot = "Rex";
24+
25+
# Any change to the signed bundle stops macOS from launching it
26+
dontFixup = true;
27+
28+
installPhase = ''
29+
runHook preInstall
30+
31+
mkdir -p "$out/Applications"
32+
cp -R Rex.app "$out/Applications/"
33+
34+
rex="$out/Applications/Rex.app/Contents/Helpers/Rex Server.rex/Contents/MacOS/rex"
35+
mkdir -p "$out/bin"
36+
ln -s "$rex" "$out/bin/rex"
37+
ln -s "$rex" "$out/bin/rex-open"
38+
for name in x/xterm-rex 78/xterm-rex r/rex 72/rex; do
39+
install -Dm644 ${inputs.rex}/xterm-rex.bin "$out/share/terminfo/$name"
40+
done
41+
install -Dm644 ${inputs.rex}/50-rex.conf "$out/share/rex/ssh_config.d/50-rex.conf"
42+
43+
runHook postInstall
44+
'';
45+
46+
meta = {
47+
description = "The multiplexer for all work";
48+
homepage = "https://superlogical.com/rex";
49+
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
50+
platforms = [ "aarch64-darwin" ];
51+
};
52+
});
53+
};
54+
}

0 commit comments

Comments
 (0)