git.delta.rocks / remowt / refs/commits / 69f690d8d645

difftreelog

ci add nix build

rrlopwywYaroslav Bolyukin2026-01-25parent: #14d995b.patch.diff
in: trunk

10 files changed

modified.gitignorediffbeforeafterboth
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /target
+/.direnv
modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
306 packageslockfile v3
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,5 +4,52 @@
 package.version = "0.1.0"
 
 [workspace.dependencies]
-bifrostlink = { path = "../bifrostlink/crates/bifrostlink" }
-bifrostlink-ports = { path = "../bifrostlink/crates/bifrostlink-ports" }
+remowt-fs = { path = "crates/remowt-fs" }
+remowt-pty = { path = "crates/remowt-pty" }
+remowt-systemd = { path = "crates/remowt-systemd" }
+remowt-client = { path = "crates/remowt-client" }
+polkit-shared = { version = "0.1.0", path = "crates/polkit-shared" }
+remowt-link-shared = { version = "0.1.0", path = "crates/remowt-link-shared" }
+ui-prompt = { version = "0.1.0", path = "crates/ui-prompt" }
+
+bifrostlink = "0.2.0"
+bifrostlink-macros = "0.2.0"
+bifrostlink-ports = "0.2.0"
+
+camino = "1.2.2"
+anyhow = "1.0.86"
+async-trait = "0.1.81"
+bytes = "1.11.0"
+clap = "4.5.16"
+futures = "0.3.30"
+futures-util = "0.3.30"
+nix = "0.29.0"
+openssh = "0.11.0"
+pam-client = "0.5.0"
+rand = "0.8.5"
+russh = { version = "0.61.2", default-features = false, features = [
+	"ring",
+	"flate2",
+	"rsa",
+] }
+russh-config = "0.58.0"
+serde = "1.0.228"
+serde_json = "1.0.149"
+tempdir = "0.3.7"
+tempfile = "3"
+tokio = "1.39.3"
+tokio-stream = "0.1.15"
+tokio-util = "0.7.11"
+tracing = "0.1.40"
+tracing-subscriber = "0.3.18"
+uuid = "1.10.0"
+zbus = "4.4.0"
+zbus_polkit = "4.0.0"
+thiserror = "2.0.18"
+
+[profile.release]
+strip = true
+panic = "abort"
+opt-level = "z"
+lto = true
+codegen-units = 1
modifiedJustfilediffbeforeafterboth
--- a/Justfile
+++ b/Justfile
@@ -10,3 +10,6 @@
 dev-deploy: dev-build dev-install
 	ssh edgeworth2 mkdir -p /home/lach/.remowt
 	rsync -arv ./target/x86_64-unknown-linux-musl/release/remowt-agent edgeworth2:/home/lach/.remowt/remowt-agent
+
+dev-ssh: dev-deploy
+	cargo run -p remowt-ssh
modifiedflake.lockdiffbeforeafterboth
--- a/flake.lock
+++ b/flake.lock
@@ -1,17 +1,11 @@
 {
   "nodes": {
     "crane": {
-      "inputs": {
-        "nixpkgs": [
-          "nixpkgs"
-        ]
-      },
       "locked": {
-        "lastModified": 1721842668,
-        "narHash": "sha256-k3oiD2z2AAwBFLa4+xfU+7G5fisRXfkvrMTCJrjZzXo=",
+        "lastModified": 1769287525,
         "owner": "ipetkov",
         "repo": "crane",
-        "rev": "529c1a0b1f29f0d78fa3086b8f6a134c71ef3aaf",
+        "rev": "0314e365877a85c9e5758f9ea77a9972afbb4c21",
         "type": "github"
       },
       "original": {
@@ -27,11 +21,10 @@
         ]
       },
       "locked": {
-        "lastModified": 1719994518,
-        "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
+        "lastModified": 1768135262,
         "owner": "hercules-ci",
         "repo": "flake-parts",
-        "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
+        "rev": "80daad04eddbbf5a4d883996a73f3f542fa437ac",
         "type": "github"
       },
       "original": {
@@ -42,15 +35,15 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1722124366,
-        "narHash": "sha256-9vxADQev2fhutwWOO+ZzjPPa2v0YSrlv3UkwoOhrJCU=",
+        "lastModified": 1769329654,
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "1d72886b8acb7ba78955e6f11531dc014a75886b",
+        "rev": "0482db4f85e69827a15c93c30cea4a9c8e344d7f",
         "type": "github"
       },
       "original": {
         "owner": "nixos",
+        "ref": "release-25.11",
         "repo": "nixpkgs",
         "type": "github"
       }
@@ -71,11 +64,10 @@
         ]
       },
       "locked": {
-        "lastModified": 1722046723,
-        "narHash": "sha256-G7/gHz8ORRvHd1/RIURrdcswKRPe9K0FsIYR4v5jSWo=",
+        "lastModified": 1769309768,
         "owner": "oxalica",
         "repo": "rust-overlay",
-        "rev": "56baac5e6b2743d4730e664ea64f6d8a2aad0fbb",
+        "rev": "140c9dc582cb73ada2d63a2180524fcaa744fad5",
         "type": "github"
       },
       "original": {
@@ -85,20 +77,11 @@
       }
     },
     "shelly": {
-      "inputs": {
-        "flake-parts": [
-          "flake-parts"
-        ],
-        "nixpkgs": [
-          "nixpkgs"
-        ]
-      },
       "locked": {
-        "lastModified": 1718420551,
-        "narHash": "sha256-NU8NBXVPj0KuY4Tl/LtZPrbX3PmmmgPuhk/1pzm9cyk=",
+        "lastModified": 1756323923,
         "owner": "CertainLach",
         "repo": "shelly",
-        "rev": "4f70221f3f9ad9058f590eefb25251b6760aaa47",
+        "rev": "b5dd29a500db04f54a9f1c2bf81cdd84df8b0cd7",
         "type": "github"
       },
       "original": {
modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -1,7 +1,7 @@
 {
-  description = "Jrsonnet";
+  description = "Remowt";
   inputs = {
-    nixpkgs.url = "github:nixos/nixpkgs";
+    nixpkgs.url = "github:nixos/nixpkgs/release-25.11";
     flake-parts = {
       url = "github:hercules-ci/flake-parts";
       inputs.nixpkgs-lib.follows = "nixpkgs";
@@ -10,62 +10,75 @@
       url = "github:oxalica/rust-overlay";
       inputs.nixpkgs.follows = "nixpkgs";
     };
-    crane = {
-      url = "github:ipetkov/crane";
-      inputs.nixpkgs.follows = "nixpkgs";
-    };
-    shelly = {
-      url = "github:CertainLach/shelly";
-      inputs = {
-        flake-parts.follows = "flake-parts";
-        nixpkgs.follows = "nixpkgs";
-      };
-    };
+    crane.url = "github:ipetkov/crane";
+    shelly.url = "github:CertainLach/shelly";
   };
-  outputs = inputs @ {
-    nixpkgs,
-    flake-parts,
-    rust-overlay,
-    crane,
-    ...
-  }:
-    flake-parts.lib.mkFlake {inherit inputs;} {
-      imports = [inputs.shelly.flakeModule ./nix/nixos-modules.nix];
+  outputs =
+    inputs@{
+      nixpkgs,
+      flake-parts,
+      rust-overlay,
+      crane,
+      ...
+    }:
+    flake-parts.lib.mkFlake { inherit inputs; } {
+      imports = [
+        inputs.shelly.flakeModule
+        ./nix/nixos-modules.nix
+      ];
       systems = nixpkgs.lib.systems.flakeExposed;
-      perSystem = {
-        config,
-        system,
-        pkgs,
-        ...
-      }: let
-        rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
-        craneLib = (crane.mkLib pkgs).overrideToolchain rust;
-      in {
-        _module.args.pkgs = import nixpkgs {
-          inherit system;
-          overlays = [rust-overlay.overlays.default];
-        };
-        packages.polkit-backend = pkgs.callPackage ./nix/polkit-backend.nix {
-          inherit craneLib;
-        };
-        shelly.shells.default = {
-          factory = craneLib.devShell;
-          packages = with pkgs; [
-            cargo-edit
-            cargo-asm
-            cargo-outdated
-            lld
-            hyperfine
-            valgrind
-            kcachegrind
-            graphviz
-            cargo-release
-            rustPlatform.bindgenHook
-            pam
+      perSystem =
+        {
+          config,
+          self',
+          system,
+          pkgs,
+          ...
+        }:
+        let
+          rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
+          craneLib = (crane.mkLib pkgs).overrideToolchain rust;
+        in
+        {
+          _module.args.pkgs = import nixpkgs {
+            inherit system;
+            overlays = [ rust-overlay.overlays.default ];
+          };
+          packages = let
+            remowtAgent = pkgs.callPackage ./nix/remowt-agent.nix {
+              inherit craneLib;
+            };
+          in {
+            polkit-backend = pkgs.callPackage ./nix/polkit-backend.nix {
+              inherit craneLib;
+            };
+            remowt-agent = remowtAgent.x86_64;
+            remowt-agent-aarch64 = remowtAgent.aarch64;
+            remowt-agent-armv7l = remowtAgent.armv7l;
+            remowt-agents = pkgs.callPackage ./nix/remowt-agents-bundle.nix {
+              agents = remowtAgent;
+            };
+            remowt-ssh = pkgs.callPackage ./nix/remowt-ssh.nix {
+              inherit craneLib;
+              agents = self'.packages.remowt-agents;
+            };
+          };
+          shelly.shells.default = {
+            factory = craneLib.devShell;
+            packages = with pkgs; [
+              cargo-edit
+              cargo-outdated
+              lld
+              hyperfine
+              valgrind
+              graphviz
+              cargo-release
+              rustPlatform.bindgenHook
+              pam
               just
-          ];
+            ];
+          };
+          formatter = pkgs.alejandra;
         };
-        formatter = pkgs.alejandra;
-      };
     };
 }
addednix/remowt-agent.nixdiffbeforeafterboth
--- /dev/null
+++ b/nix/remowt-agent.nix
@@ -0,0 +1,43 @@
+{
+  craneLib,
+  lib,
+  pkgs,
+}: let
+  crateName = "remowt-agent";
+
+  buildFor = {
+    target,
+    crossPkgs,
+  }: let
+    cc = crossPkgs.stdenv.cc;
+    linkerEnv = "CARGO_TARGET_${lib.toUpper (builtins.replaceStrings ["-"] ["_"] target)}_LINKER";
+  in
+    craneLib.buildPackage ({
+        src = craneLib.cleanCargoSource ../.;
+        pname = "${crateName}-${target}";
+
+        cargoExtraArgs = "--locked -p ${crateName}";
+
+        CARGO_BUILD_TARGET = target;
+        CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
+
+        depsBuildBuild = [cc];
+        doCheck = false;
+      }
+      // {
+        ${linkerEnv} = "${cc}/bin/${cc.targetPrefix}cc";
+      });
+in {
+  x86_64 = buildFor {
+    target = "x86_64-unknown-linux-musl";
+    crossPkgs = pkgs;
+  };
+  aarch64 = buildFor {
+    target = "aarch64-unknown-linux-musl";
+    crossPkgs = pkgs.pkgsCross.aarch64-multiplatform-musl;
+  };
+  armv7l = buildFor {
+    target = "armv7-unknown-linux-musleabihf";
+    crossPkgs = pkgs.pkgsCross.armv7l-hf-multiplatform.pkgsMusl;
+  };
+}
addednix/remowt-agents-bundle.nixdiffbeforeafterboth
--- /dev/null
+++ b/nix/remowt-agents-bundle.nix
@@ -0,0 +1,16 @@
+{
+  runCommandLocal,
+  agents,
+}:
+runCommandLocal "remowt-agents" { } ''
+  mkdir -p $out
+  cp ${agents.x86_64}/bin/remowt-agent  $out/remowt-agent-x86_64
+  cp ${agents.aarch64}/bin/remowt-agent $out/remowt-agent-aarch64
+  cp ${agents.armv7l}/bin/remowt-agent  $out/remowt-agent-armv7l
+  chmod +w $out/remowt-agent-*
+
+  for arch in x86_64 aarch64 armv7l; do
+    hash=$(sha256sum "$out/remowt-agent-$arch" | cut -d' ' -f1)
+    printf '%s %s\n' "$arch" "$hash" >> $out/hashes
+  done
+''
addednix/remowt-ssh.nixdiffbeforeafterboth
--- /dev/null
+++ b/nix/remowt-ssh.nix
@@ -0,0 +1,18 @@
+{
+  craneLib,
+  agents,
+  rofi,
+}:
+let
+  crateName = "remowt-ssh";
+in
+craneLib.buildPackage {
+  src = craneLib.cleanCargoSource ../.;
+
+  pname = crateName;
+
+  cargoExtraArgs = "--locked -p ${crateName}";
+
+  REMOWT_AGENTS_DIR = "${agents}";
+  ROFI = "${rofi}/bin/rofi";
+}
modifiedrust-toolchain.tomldiffbeforeafterboth
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,4 +1,8 @@
 [toolchain]
-channel = "nightly-2024-07-20"
+channel = "1.93.0"
 components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
-targets = ["x86_64-unknown-linux-musl"]
+targets = [
+  "x86_64-unknown-linux-musl",
+  "aarch64-unknown-linux-musl",
+  "armv7-unknown-linux-musleabihf",
+]