diff --git a/.tangled/workflows/deploy.yaml b/.tangled/workflows/deploy.yaml index 6fe32ce..9fe168b 100644 --- a/.tangled/workflows/deploy.yaml +++ b/.tangled/workflows/deploy.yaml @@ -5,16 +5,13 @@ when: dependencies: nixpkgs: - nix - - cargo - - rustc - - rustfmt - - clippy - steps: - - name: "lint & fmt" - command: | - cargo clippy - cargo fmt --check - - name: test - command: | - cargo test + - name: build + command: nix build + #- name: "lint & fmt" + # command: | + # cargo clippy + # cargo fmt --check + #- name: test + # command: | + # cargo test diff --git a/flake.lock b/flake.lock index 33048f6..5844885 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,28 @@ "type": "github" } }, + "fenix_2": { + "inputs": { + "nixpkgs": [ + "naersk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src_2" + }, + "locked": { + "lastModified": 1752475459, + "narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -39,6 +61,27 @@ "type": "github" } }, + "naersk": { + "inputs": { + "fenix": "fenix_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752689277, + "narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=", + "owner": "nix-community", + "repo": "naersk", + "rev": "0e72363d0938b0208d6c646d10649164c43f4d64", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1751741127, @@ -59,6 +102,7 @@ "inputs": { "fenix": "fenix", "flake-utils": "flake-utils", + "naersk": "naersk", "nixpkgs": "nixpkgs" } }, @@ -79,6 +123,23 @@ "type": "github" } }, + "rust-analyzer-src_2": { + "flake": false, + "locked": { + "lastModified": 1752428706, + "narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "591e3b7624be97e4443ea7b5542c191311aa141d", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 9bda942..3c4fdde 100644 --- a/flake.nix +++ b/flake.nix @@ -6,35 +6,53 @@ url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; - #naersk = { - # url = "github:nix-community/naersk"; - # inputs.nixpkgs.follows = "nixpkgs"; - #}; + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, flake-utils, fenix, nixpkgs }: + outputs = { self, flake-utils, fenix, naersk, nixpkgs }: flake-utils.lib.eachDefaultSystem (system: let pkgs = (import nixpkgs) { inherit system; }; - #toolchain = fenix.packages.${system}.stable; + toolchain = fenix.packages.${system}.stable.toolchain; - #naersk' = naersk.lib.${system}.override { - # rustc = toolchain.rustc; - # cargo = toolchain.cargo; - #}; + naersk' = naersk.lib.${system}.override { + rustc = toolchain; + cargo = toolchain; + }; in { # For `nix build` & `nix run`: - #defaultPackage = naersk'.buildPackage { - # src = ./.; - #}; + packages.default = naersk'.buildPackage { + src = ./.; + }; + + formatter = toolchain; + + checks = { + build = self.packages.${system}.default; + #fmt = pkgs.runCommand "fmt-check" { buildInputs = [ toolchain ]; } '' + # cargo fmt --check + # touch $out + #''; + #clippy = pkgs.runCommand "clippy-check" { buildInputs = [ toolchain ]; } '' + # cargo clippy + # touch $out + #''; + #tests = pkgs.runCommand "tests" { buildInputs = [ toolchain ]; } '' + # cargo test + # touch $out + #''; + }; # For `nix develop` (optional, can be skipped): - devShell = pkgs.mkShell { - nativeBuildInputs = [ fenix.packages.${system}.stable.toolchain ]; + devShells.default = pkgs.mkShell { + buildInputs = [ toolchain ]; }; } );