Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
flake: Add NixOS tests to checks
✓ 1/1 checks passed lorenz wants to merge 3 commits into master · opened 13 days ago
All checks passed — 1 passed View logs ↗
2 files changed +84 -49 6b460c44 cdd3e104
modified flake.lock
@@ -3,11 +3,11 @@
    "advisory-db": {
      "flake": false,
      "locked": {
-
        "lastModified": 1771365779,
-
        "narHash": "sha256-KaMQHARfo0nykDbE2pNW8GGCm5k8kIiqZ0IQI0RRYWE=",
+
        "lastModified": 1778144201,
+
        "narHash": "sha256-8D+QpFiD1n1MJ9A4tPAZ4TcXeDDa8j2Btp6yk8B3xHg=",
        "owner": "rustsec",
        "repo": "advisory-db",
-
        "rev": "532daba438136696af8764d4d69ea83ed8694da9",
+
        "rev": "881a159d8d70075fe79eb23605e7127a9c2a738a",
        "type": "github"
      },
      "original": {
@@ -18,11 +18,11 @@
    },
    "crane": {
      "locked": {
-
        "lastModified": 1771121070,
-
        "narHash": "sha256-aIlv7FRXF9q70DNJPI237dEDAznSKaXmL5lfK/Id/bI=",
+
        "lastModified": 1778106249,
+
        "narHash": "sha256-cM/AuKy5tMhwOOQIbha8ZRRMHVfNf7cv2aljIw+qoCg=",
        "owner": "ipetkov",
        "repo": "crane",
-
        "rev": "a2812c19f1ed2e5ed5ce2ef7109798b575c180e1",
+
        "rev": "6d015ea29630b7ad2402841386da2cb617a470a7",
        "type": "github"
      },
      "original": {
@@ -74,11 +74,11 @@
        ]
      },
      "locked": {
-
        "lastModified": 1770726378,
-
        "narHash": "sha256-kck+vIbGOaM/dHea7aTBxdFYpeUl/jHOy5W3eyRvVx8=",
+
        "lastModified": 1776796298,
+
        "narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=",
        "owner": "cachix",
        "repo": "git-hooks.nix",
-
        "rev": "5eaaedde414f6eb1aea8b8525c466dc37bba95ae",
+
        "rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad",
        "type": "github"
      },
      "original": {
@@ -110,32 +110,32 @@
    },
    "nixpkgs-stable": {
      "locked": {
-
        "lastModified": 1771371298,
-
        "narHash": "sha256-AudCpsjP7MfL1mAusLjyyiOz+SF+JujxWzoSAhjk+Og=",
+
        "lastModified": 1778003029,
+
        "narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=",
        "owner": "NixOS",
        "repo": "nixpkgs",
-
        "rev": "bf117123cd658283c5b5c587e59091168323ad61",
+
        "rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
-
        "ref": "release-25.11",
+
        "ref": "nixos-25.11",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-unstable": {
      "locked": {
-
        "lastModified": 1771371298,
-
        "narHash": "sha256-AudCpsjP7MfL1mAusLjyyiOz+SF+JujxWzoSAhjk+Og=",
+
        "lastModified": 1777954456,
+
        "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=",
        "owner": "NixOS",
        "repo": "nixpkgs",
-
        "rev": "bf117123cd658283c5b5c587e59091168323ad61",
+
        "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
-
        "ref": "release-25.11",
+
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
@@ -161,11 +161,11 @@
        ]
      },
      "locked": {
-
        "lastModified": 1771384185,
-
        "narHash": "sha256-KvmjUeA7uODwzbcQoN/B8DCZIbhT/Q/uErF1BBMcYnw=",
+
        "lastModified": 1778123869,
+
        "narHash": "sha256-hV9D8ET33kXjdoMXBT2bwM/j8WQM1SP/dVKZtjQKhAQ=",
        "owner": "oxalica",
        "repo": "rust-overlay",
-
        "rev": "23dd7fa91602a68bd04847ac41bc10af1e6e2fd2",
+
        "rev": "592e5dedf04f0eaff1ed0f01ce5db7407d9fc7be",
        "type": "github"
      },
      "original": {
modified flake.nix
@@ -2,8 +2,8 @@
  description = "Radicle";

  inputs = {
-
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/release-25.11";
-
    nixpkgs-stable.url = "github:NixOS/nixpkgs/release-25.11";
+
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
+
    nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.11";
    nixpkgs.follows = "nixpkgs-stable";

    crane.url = "github:ipetkov/crane";
@@ -34,20 +34,47 @@

  outputs = {
    self,
-
    nixpkgs,
+
    advisory-db,
    crane,
    flake-utils,
-
    advisory-db,
+
    nixpkgs,
+
    nixpkgs-stable,
+
    nixpkgs-unstable,
    rust-overlay,
    ...
-
  } @ inputs:
+
  } @ inputs: let
+
    version = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
+

+
    lib = nixpkgs.lib;
+

+
    srcFilters = pkgs: path: type:
+
      builtins.any (suffix: lib.hasSuffix suffix path) [
+
        ".sql" # schemas
+
        ".diff" # testing
+
        ".md" # testing
+
        ".adoc" # man pages
+
        ".json" # testing samples
+
        ".txt" # might be included with `include_str!`
+
        "rad-cob-multiset" # testing external COBs
+
      ]
+
      ||
+
      # Default filter from crane (allow .rs files)
+
      ((crane.mkLib pkgs).filterCargoSources path type);
+

+
    mkSrc = pkgs:
+
      lib.cleanSourceWith {
+
        src = ./.;
+
        filter = srcFilters pkgs;
+
      };
+
  in
    flake-utils.lib.eachDefaultSystem (system: let
-
      lib = nixpkgs.lib;
      pkgs = import nixpkgs {
        inherit system;
        overlays = [(import rust-overlay)];
      };

+
      src = mkSrc pkgs;
+

      msrv = let
        msrv = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.rust-version;
      in rec {
@@ -70,27 +97,8 @@
        commonArgs = mkCommonArgs craneLib;
      };

-
      srcFilters = path: type:
-
        builtins.any (suffix: lib.hasSuffix suffix path) [
-
          ".sql" # schemas
-
          ".diff" # testing
-
          ".md" # testing
-
          ".adoc" # man pages
-
          ".json" # testing samples
-
          ".txt" # might be included with `include_str!`
-
          "rad-cob-multiset" # testing external COBs
-
        ]
-
        ||
-
        # Default filter from crane (allow .rs files)
-
        (rustup.craneLib.filterCargoSources path type);
-

-
      src = lib.cleanSourceWith {
-
        src = ./.;
-
        filter = srcFilters;
-
      };
-

      basicArgs = {
-
        inherit src;
+
        src = mkSrc pkgs;
        pname = "Heartwood";
        strictDeps = true;
      };
@@ -118,7 +126,7 @@

          env =
            {
-
              RADICLE_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
+
              RADICLE_VERSION = version;
            }
            // (
              if self ? rev || self ? dirtyRev
@@ -329,7 +337,21 @@
              env.CARGO_PROFILE = "dev";
              cargoNextestExtraArgs = "--no-capture";
            });
-
        };
+
        }
+
        // (
+
          let
+
            nixos = nixpkgs:
+
              (import nixpkgs {
+
                inherit system;
+
                overlays = [
+
                  self.overlays.default
+
                ];
+
              }).radicle-node.tests.nixos-run;
+
          in {
+
            nixos-stable = nixos nixpkgs-stable;
+
            nixos-unstable = nixos nixpkgs-unstable;
+
          }
+
        );

      packages = let
        crates = buildCrates {};
@@ -373,5 +395,18 @@
          RUST_SRC_PATH = "${rustupDevShell.toolchain}/lib/rustlib/src/rust/library";
        };
      };
-
    });
+
    })
+
    // {
+
      overlays = {
+
        default = final: prev: {
+
          radicle-node = prev.radicle-node.overrideAttrs (finalAttrs: prevAttrs: {
+
            inherit version;
+
            src = mkSrc final;
+
            cargoDeps = final.rustPlatform.importCargoLock {
+
              lockFile = ./Cargo.lock;
+
            };
+
          });
+
        };
+
      };
+
    };
}