Browse Source

refactor(flake): remove crane build system and simplify flake dependencies

Remove crane and fenix dependencies along with their associated build
infrastructure. This simplifies the flake to focus on development
environments while removing package builds and applications.
thesimplekid 3 months ago
parent
commit
fef1cda009
2 changed files with 16 additions and 103 deletions
  1. 12 12
      flake.lock
  2. 4 91
      flake.nix

+ 12 - 12
flake.lock

@@ -2,11 +2,11 @@
   "nodes": {
   "nodes": {
     "crane": {
     "crane": {
       "locked": {
       "locked": {
-        "lastModified": 1750266157,
-        "narHash": "sha256-tL42YoNg9y30u7zAqtoGDNdTyXTi8EALDeCB13FtbQA=",
+        "lastModified": 1753316655,
+        "narHash": "sha256-tzWa2kmTEN69OEMhxFy+J2oWSvZP5QhEgXp3TROOzl0=",
         "owner": "ipetkov",
         "owner": "ipetkov",
         "repo": "crane",
         "repo": "crane",
-        "rev": "e37c943371b73ed87faf33f7583860f81f1d5a48",
+        "rev": "f35a3372d070c9e9ccb63ba7ce347f0634ddf3d2",
         "type": "github"
         "type": "github"
       },
       },
       "original": {
       "original": {
@@ -23,11 +23,11 @@
         "rust-analyzer-src": []
         "rust-analyzer-src": []
       },
       },
       "locked": {
       "locked": {
-        "lastModified": 1750833544,
-        "narHash": "sha256-e5W27mfPGiM35qr0DjTUzLHP4ET2MbvRc4HJHScw/ko=",
+        "lastModified": 1753511988,
+        "narHash": "sha256-wC9PR+rPjmcpnPdOIDwyNwQiRhNsuDs3oZY3t42f4uA=",
         "owner": "nix-community",
         "owner": "nix-community",
         "repo": "fenix",
         "repo": "fenix",
-        "rev": "c3940d9ff4d37e965e5841149367234c2aad1ab6",
+        "rev": "25db7a6f4de7dea678620785e03fbc4560c00672",
         "type": "github"
         "type": "github"
       },
       },
       "original": {
       "original": {
@@ -93,11 +93,11 @@
     },
     },
     "nixpkgs": {
     "nixpkgs": {
       "locked": {
       "locked": {
-        "lastModified": 1750622754,
-        "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=",
+        "lastModified": 1753345091,
+        "narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=",
         "owner": "NixOS",
         "owner": "NixOS",
         "repo": "nixpkgs",
         "repo": "nixpkgs",
-        "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1",
+        "rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9",
         "type": "github"
         "type": "github"
       },
       },
       "original": {
       "original": {
@@ -160,11 +160,11 @@
         ]
         ]
       },
       },
       "locked": {
       "locked": {
-        "lastModified": 1750819193,
-        "narHash": "sha256-XvkupGPZqD54HuKhN/2WhbKjAHeTl1UEnWspzUzRFfA=",
+        "lastModified": 1753497720,
+        "narHash": "sha256-yzZkDMVfPpNyTciQOfriWpRXrgGNT/cvrFAEQZ//SZs=",
         "owner": "oxalica",
         "owner": "oxalica",
         "repo": "rust-overlay",
         "repo": "rust-overlay",
-        "rev": "1ba3b9c59b68a4b00156827ad46393127b51b808",
+        "rev": "c8b8b812010515b7d9bd7e538f06a9f4edb373ff",
         "type": "github"
         "type": "github"
       },
       },
       "original": {
       "original": {

+ 4 - 91
flake.nix

@@ -27,7 +27,7 @@
     pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
     pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
   };
   };
 
 
-  outputs = { self, nixpkgs, rust-overlay, flake-utils, pre-commit-hooks, crane, fenix, ... }:
+  outputs = { self, nixpkgs, rust-overlay, flake-utils, pre-commit-hooks, ... }:
     flake-utils.lib.eachDefaultSystem (system:
     flake-utils.lib.eachDefaultSystem (system:
       let
       let
         overlays = [ (import rust-overlay) ];
         overlays = [ (import rust-overlay) ];
@@ -87,80 +87,9 @@
           libz
           libz
         ] ++ libsDarwin;
         ] ++ libsDarwin;
 
 
-        # WASM deps
-        WASMInputs = with pkgs; [
-        ];
-
-
-
-        craneLib = crane.mkLib pkgs;
-        src = craneLib.cleanCargoSource ./.;
 
 
         # Common arguments can be set here to avoid repeating them later
         # Common arguments can be set here to avoid repeating them later
-        commonArgs = {
-          inherit src;
-          strictDeps = true;
-
-          buildInputs = [
-            # Add additional build inputs here
-            pkgs.protobuf
-            pkgs.pkg-config
-          ] ++ lib.optionals pkgs.stdenv.isDarwin [
-            # Additional darwin specific inputs can be set here
-            pkgs.libiconv
-          ];
-
-          # Additional environment variables can be set directly
-          # MY_CUSTOM_VAR = "some value";
-          PROTOC = "${pkgs.protobuf}/bin/protoc";
-          PROTOC_INCLUDE = "${pkgs.protobuf}/include";
-        };
-
-
-        craneLibLLvmTools = craneLib.overrideToolchain
-          (fenix.packages.${system}.complete.withComponents [
-            "cargo"
-            "llvm-tools"
-            "rustc"
-          ]);
-
-        cargoArtifacts = craneLib.buildDepsOnly commonArgs;
-
-        individualCrateArgs = commonArgs // {
-          inherit cargoArtifacts;
-          inherit (craneLib.crateNameFromCargoToml { inherit src; }) version;
-          # NB: we disable tests since we'll run them all via cargo-nextest
-          doCheck = false;
-        };
-
-        fileSetForCrate = crate: lib.fileset.toSource {
-          root = ./.;
-          fileset = lib.fileset.unions [
-            ./Cargo.toml
-            ./Cargo.lock
-            (craneLib.fileset.commonCargoSources ./crates/cdk)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-axum)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-cln)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-lnd)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-fake-wallet)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-lnbits)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-redb)
-            (craneLib.fileset.commonCargoSources ./crates/cdk-sqlite)
-            ./crates/cdk-sqlite/src/mint/migrations
-            ./crates/cdk-sqlite/src/wallet/migrations
-            (craneLib.fileset.commonCargoSources crate)
-          ];
-        };
-
-        cdk-mintd = craneLib.buildPackage (individualCrateArgs // {
-          pname = "cdk-mintd";
-          name = "cdk-mintd-${individualCrateArgs.version}";
-          cargoExtraArgs = "-p cdk-mintd";
-          src = fileSetForCrate ./crates/cdk-mintd;
-        });
-
-
-        nativeBuildInputs = with pkgs; [
+        nativeBuildInputs = [
           #Add additional build inputs here
           #Add additional build inputs here
         ] ++ lib.optionals isDarwin [
         ] ++ lib.optionals isDarwin [
           # Additional darwin specific native inputs can be set here
           # Additional darwin specific native inputs can be set here
@@ -201,22 +130,6 @@
             };
             };
         };
         };
 
 
-
-        packages = {
-          inherit cdk-mintd;
-          default = cdk-mintd;
-        } // lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
-          my-workspace-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // {
-            inherit cargoArtifacts;
-          });
-        };
-
-        apps = {
-          cdk-mintd = flake-utils.lib.mkApp {
-            drv = cdk-mintd;
-          };
-        };
-
         devShells =
         devShells =
           let
           let
             # pre-commit-checks
             # pre-commit-checks
@@ -238,13 +151,13 @@
               cargo update -p pest_meta --precise 2.8.0
               cargo update -p pest_meta --precise 2.8.0
               cargo update -p pest --precise 2.8.0
               cargo update -p pest --precise 2.8.0
               ";
               ";
-              buildInputs = buildInputs ++ WASMInputs ++ [ msrv_toolchain ];
+              buildInputs = buildInputs ++ [ msrv_toolchain ];
               inherit nativeBuildInputs;
               inherit nativeBuildInputs;
             } // envVars);
             } // envVars);
 
 
             stable = pkgs.mkShell ({
             stable = pkgs.mkShell ({
               shellHook = ''${_shellHook}'';
               shellHook = ''${_shellHook}'';
-              buildInputs = buildInputs ++ WASMInputs ++ [ stable_toolchain ];
+              buildInputs = buildInputs ++ [ stable_toolchain ];
               inherit nativeBuildInputs;
               inherit nativeBuildInputs;
             } // envVars);
             } // envVars);