From 5aad02ae050a9d4dda642dd6650480a6d147b2be Mon Sep 17 00:00:00 2001 From: Orual Date: Sat, 27 Sep 2025 13:26:52 -0400 Subject: [PATCH] update ci and formatting --- .tangled/workflows/build.yml | 2 +- crates/jacquard-common/src/types/nsid.rs | 1 + flake.nix | 6 +- nix/modules/devshell.nix | 42 +++++------ nix/modules/rust.nix | 96 ++++++++++++------------ 5 files changed, 75 insertions(+), 72 deletions(-) diff --git a/.tangled/workflows/build.yml b/.tangled/workflows/build.yml index 807dea3..f01d5e2 100644 --- a/.tangled/workflows/build.yml +++ b/.tangled/workflows/build.yml @@ -6,7 +6,7 @@ engine: nixery dependencies: nixpkgs: - - just + #- just steps: - name: build appview diff --git a/crates/jacquard-common/src/types/nsid.rs b/crates/jacquard-common/src/types/nsid.rs index e69de29..8b13789 100644 --- a/crates/jacquard-common/src/types/nsid.rs +++ b/crates/jacquard-common/src/types/nsid.rs @@ -0,0 +1 @@ + diff --git a/flake.nix b/flake.nix index 444a176..0d690df 100644 --- a/flake.nix +++ b/flake.nix @@ -14,13 +14,13 @@ }; outputs = inputs: - inputs.flake-parts.lib.mkFlake {inherit inputs;} { + inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = import inputs.systems; # See ./nix/modules/*.nix for the modules that are imported here. imports = with builtins; map - (fn: ./nix/modules/${fn}) - (attrNames (readDir ./nix/modules)); + (fn: ./nix/modules/${fn}) + (attrNames (readDir ./nix/modules)); }; } diff --git a/nix/modules/devshell.nix b/nix/modules/devshell.nix index eb7d069..2516a7b 100644 --- a/nix/modules/devshell.nix +++ b/nix/modules/devshell.nix @@ -1,23 +1,23 @@ -{inputs, ...}: { - perSystem = { - config, - self', - pkgs, - lib, - ... - }: { - devShells.default = pkgs.mkShell { - name = "jacquard-shell"; - inputsFrom = [ - self'.devShells.rust - config.pre-commit.devShell # See ./nix/modules/pre-commit.nix - ]; - packages = with pkgs; [ - just - nixd # Nix language server - bacon - rust-analyzer - ]; +{ inputs, ... }: { + perSystem = + { config + , self' + , pkgs + , lib + , ... + }: { + devShells.default = pkgs.mkShell { + name = "jacquard-shell"; + inputsFrom = [ + self'.devShells.rust + config.pre-commit.devShell # See ./nix/modules/pre-commit.nix + ]; + packages = with pkgs; [ + just + nixd # Nix language server + bacon + rust-analyzer + ]; + }; }; - }; } diff --git a/nix/modules/rust.nix b/nix/modules/rust.nix index e600bcc..3a532e1 100644 --- a/nix/modules/rust.nix +++ b/nix/modules/rust.nix @@ -1,64 +1,66 @@ -{inputs, ...}: { +{ inputs, ... }: { imports = [ inputs.rust-flake.flakeModules.default inputs.rust-flake.flakeModules.nixpkgs # inputs.process-compose-flake.flakeModule # inputs.cargo-doc-live.flakeModule ]; - perSystem = { - config, - self', - pkgs, - lib, - ... - }: let - inherit (pkgs.stdenv) isDarwin; - inherit (pkgs.darwin) apple_sdk; + perSystem = + { config + , self' + , pkgs + , lib + , ... + }: + let + inherit (pkgs.stdenv) isDarwin; + inherit (pkgs.darwin) apple_sdk; - # Common configuration for all crates - globalCrateConfig = { - crane.clippy.enable = false; - }; - - # Common build inputs for all crates - commonBuildInputs = lib.optionals isDarwin ( - with apple_sdk.frameworks; [ - IOKit - Security - SystemConfiguration - ] - ); - in { - rust-project = { - # Source filtering to avoid unnecessary rebuilds - src = lib.cleanSourceWith { - src = inputs.self; - filter = config.rust-project.crane-lib.filterCargoSources; + # Common configuration for all crates + globalCrateConfig = { + crane.clippy.enable = false; }; - crates = { - "jacquard" = { - imports = [globalCrateConfig]; - autoWire = ["crate" "clippy"]; - path = ./../../crates/jacquard; - crane = { - args = { - buildInputs = commonBuildInputs; + + # Common build inputs for all crates + commonBuildInputs = lib.optionals isDarwin ( + with apple_sdk.frameworks; [ + IOKit + Security + SystemConfiguration + ] + ); + in + { + rust-project = { + # Source filtering to avoid unnecessary rebuilds + src = lib.cleanSourceWith { + src = inputs.self; + filter = config.rust-project.crane-lib.filterCargoSources; + }; + crates = { + "jacquard" = { + imports = [ globalCrateConfig ]; + autoWire = [ "crate" "clippy" ]; + path = ./../../crates/jacquard; + crane = { + args = { + buildInputs = commonBuildInputs; + }; }; }; - }; - "jacquard-common" = { - imports = [globalCrateConfig]; - autoWire = ["crate" "clippy"]; - path = ./../../crates/jacquard-common; - crane = { - args = { - buildInputs = commonBuildInputs; + "jacquard-common" = { + imports = [ globalCrateConfig ]; + autoWire = [ "crate" "clippy" ]; + path = ./../../crates/jacquard-common; + crane = { + args = { + buildInputs = commonBuildInputs; + }; }; }; }; }; + packages.default = self'.packages.jacquard; }; - packages.default = self'.packages.jacquard; - }; } -- 2.51.2