diff --git a/flake.lock b/flake.lock index a2c5d352..9ff341a8 100644 --- a/flake.lock +++ b/flake.lock @@ -38,6 +38,22 @@ "type": "github" } }, + "dioxus-desktop-template": { + "flake": false, + "locked": { + "lastModified": 1696553608, + "narHash": "sha256-yEN3pRkfEx9ydEeFJkXOxQ+VcQsuqPrxN5F+2flb9uw=", + "owner": "srid", + "repo": "dioxus-desktop-template", + "rev": "25a09db72113f7a9d9cb85c6d96e97a18139d260", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "dioxus-desktop-template", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -108,22 +124,6 @@ "type": "github" } }, - "leptos-fullstack": { - "flake": false, - "locked": { - "lastModified": 1694027158, - "narHash": "sha256-XzDBUA5jzTFDiLJtgvknAb9MuXwEGXmAd/ZoTqVUg+o=", - "owner": "srid", - "repo": "leptos-fullstack", - "rev": "4203055c17476616bec375cd7e471e91f70d26d0", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "leptos-fullstack", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1696234590, @@ -193,8 +193,8 @@ "inputs": { "cargo-doc-live": "cargo-doc-live", "crane": "crane", + "dioxus-desktop-template": "dioxus-desktop-template", "flake-parts": "flake-parts", - "leptos-fullstack": "leptos-fullstack", "nixpkgs": "nixpkgs", "process-compose-flake": "process-compose-flake", "rust-overlay": "rust-overlay_2", diff --git a/flake.nix b/flake.nix index 419e9db7..d7b60300 100644 --- a/flake.nix +++ b/flake.nix @@ -18,8 +18,8 @@ process-compose-flake.url = "github:Platonic-Systems/process-compose-flake"; cargo-doc-live.url = "github:srid/cargo-doc-live"; - leptos-fullstack.url = "github:srid/leptos-fullstack"; - leptos-fullstack.flake = false; + dioxus-desktop-template.url = "github:srid/dioxus-desktop-template"; + dioxus-desktop-template.flake = false; }; outputs = inputs: @@ -30,7 +30,7 @@ inputs.treefmt-nix.flakeModule inputs.process-compose-flake.flakeModule inputs.cargo-doc-live.flakeModule - (inputs.leptos-fullstack + /nix/flake-module.nix) + (inputs.dioxus-desktop-template + /nix/flake-module.nix) ./rust.nix ./e2e/flake-module.nix ]; diff --git a/rust.nix b/rust.nix index 9a0fd7c6..cdc1eb93 100644 --- a/rust.nix +++ b/rust.nix @@ -1,6 +1,6 @@ # Nix module for the Rust part of the project # -# This uses https://github.com/srid/leptos-fullstack/blob/master/nix/flake-module.nix +# This uses https://github.com/srid/dioxus-desktop-template/blob/master/nix/flake-module.nix { perSystem = { config, self', pkgs, lib, system, ... }: let @@ -14,49 +14,50 @@ ]); in { - leptos-fullstack.overrideCraneArgs = oa: - let - # 'cargo leptos test' doesn't run tests for all crates in the - # workspace. We do it here. - run-test = pkgs.writeShellApplication { - name = "run-test"; - text = '' - set -xe + dioxus-desktop = { + inherit rustBuildInputs; + overrideCraneArgs = oa: + let + # 'cargo leptos test' doesn't run tests for all crates in the + # workspace. We do it here. + run-test = pkgs.writeShellApplication { + name = "run-test"; + text = '' + set -xe - ${oa.cargoTestCommand} + ${oa.cargoTestCommand or ""} - # Disable tests on macOS for https://github.com/garnix-io/issues/issues/69 - # If/when we move to Jenkins, this won't be necessary. - ${if !pkgs.stdenv.isDarwin - then '' - # Run `cargo test` using the same settings as `cargo leptos test` - # In particular: target-dir and features - cargo test --target-dir=target/server --no-default-features --features=ssr - cargo test --target-dir=target/front --no-default-features --features=hydrate - '' - else "" - } - ''; + # Disable tests on macOS for https://github.com/garnix-io/issues/issues/69 + # If/when we move to Jenkins, this won't be necessary. + ${if !pkgs.stdenv.isDarwin + then '' + # Run `cargo test` using the same settings as `cargo leptos test` + # In particular: target-dir and features + cargo test --target-dir=target/server --no-default-features --features=ssr + cargo test --target-dir=target/front --no-default-features --features=hydrate + '' + else "" + } + ''; + }; + in + { + nativeBuildInputs = (oa.nativeBuildInputs or [ ]) ++ [ + pkgs.nix # cargo tests need nix + ]; + cargoTestCommand = lib.getExe run-test; + meta.description = "WIP: nix-browser"; }; - in - { - nativeBuildInputs = (oa.nativeBuildInputs or [ ]) ++ [ - pkgs.nix # cargo tests need nix - ]; - buildInputs = (oa.buildInputs or [ ]) ++ rustBuildInputs; - cargoTestCommand = lib.getExe run-test; - meta.description = "WIP: nix-browser"; - }; + }; packages = { default = self'.packages.nix-browser; - nix-health = config.leptos-fullstack.craneLib.buildPackage { - inherit (config.leptos-fullstack) src; + nix-health = config.dioxus-desktop-template.craneLib.buildPackage { + inherit (config.dioxus-desktop-template) src; pname = "nix-health"; nativeBuildInputs = [ pkgs.nix # cargo tests need nix ]; - buildInputs = rustBuildInputs; cargoExtraArgs = "-p nix_health --features ssr"; # Disable tests on macOS for https://github.com/garnix-io/issues/issues/69 # If/when we move to Jenkins, this won't be necessary. @@ -74,7 +75,6 @@ cargo-nextest config.process-compose.cargo-doc-live.outputs.package ]; - buildInputs = rustBuildInputs; shellHook = '' echo echo "🍎🍎 Run 'just ' to get started"