Reformat with alejandra

This commit is contained in:
Invariantspace 2024-08-14 11:14:20 -07:00
parent 7b2b5b3b80
commit 52a81ddb21
No known key found for this signature in database
GPG key ID: EBC4A20067373921
53 changed files with 764 additions and 746 deletions

View file

@ -4,15 +4,19 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ texlive.combined.scheme-full ];
TEXMFHOME = "$XDG_DATA_HOME/texmf";
TEXMFVAR = "$XDG_CACHE_HOME/texlive/texmf-var";
EXMFCONFIG = "$XDG_CONFIG_HOME/texlive/texmf-config";
};
});
outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [texlive.combined.scheme-full];
TEXMFHOME = "$XDG_DATA_HOME/texmf";
TEXMFVAR = "$XDG_CACHE_HOME/texlive/texmf-var";
EXMFCONFIG = "$XDG_CONFIG_HOME/texlive/texmf-config";
};
});
}

View file

@ -4,16 +4,20 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
(rWrapper.override {
packages = with rPackages; [ tidyverse ];
})
];
};
});
outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
(rWrapper.override {
packages = with rPackages; [tidyverse];
})
];
};
});
}

View file

@ -10,114 +10,129 @@
};
};
outputs = { self, crane, fenix, flake-utils, nixpkgs, advisory-db }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system};
craneLib = crane.mkLib pkgs;
src = craneLib.path ./.;
outputs = {
self,
crane,
fenix,
flake-utils,
nixpkgs,
advisory-db,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system};
craneLib = crane.mkLib pkgs;
src = craneLib.path ./.;
# Common arguments can be set here to avoid repeating them later
commonArgs = with pkgs; {
inherit src;
strictDeps = true;
buildInputs = [
# Common arguments can be set here to avoid repeating them later
commonArgs = with pkgs; {
inherit src;
strictDeps = true;
buildInputs =
[
# Add additional build inputs here
] ++ lib.optionals stdenv.isDarwin [
]
++ lib.optionals stdenv.isDarwin [
# Additional darwin specific inputs can be set here
libiconv
];
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
};
# Additional environment variables can be set directly
# MY_CUSTOM_VAR = "some value";
};
craneLibLLvmTools = craneLib.overrideToolchain
(fenixPkgs.complete.withComponents [
"cargo"
"llvm-tools"
"rustc"
]);
craneLibLLvmTools =
craneLib.overrideToolchain
(fenixPkgs.complete.withComponents [
"cargo"
"llvm-tools"
"rustc"
]);
# Build *just* the cargo dependencies, so we can reuse
# all of that work (e.g. via cachix) when running in CI
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
# Build *just* the cargo dependencies, so we can reuse
# all of that work (e.g. via cachix) when running in CI
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
# Build the actual crate itself, reusing the dependency
# artifacts from above.
crate = craneLib.buildPackage (commonArgs // {
# Build the actual crate itself, reusing the dependency
# artifacts from above.
crate = craneLib.buildPackage (commonArgs
// {
inherit cargoArtifacts;
});
in
{
checks = {
# Build the crate as part of `nix flake check` for convenience
inherit crate;
in {
checks = {
# Build the crate as part of `nix flake check` for convenience
inherit crate;
# Run clippy (and deny all warnings) on the crate source,
# again, resuing the dependency artifacts from above.
#
# Note that this is done as a separate derivation so that
# we can block the CI if there are issues here, but not
# prevent downstream consumers from building our crate by itself.
clippy = craneLib.cargoClippy (commonArgs // {
# Run clippy (and deny all warnings) on the crate source,
# again, resuing the dependency artifacts from above.
#
# Note that this is done as a separate derivation so that
# we can block the CI if there are issues here, but not
# prevent downstream consumers from building our crate by itself.
clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
doc = craneLib.cargoDoc (commonArgs // {
doc = craneLib.cargoDoc (commonArgs
// {
inherit cargoArtifacts;
});
# Check formatting
fmt = craneLib.cargoFmt {
inherit src;
};
# Check formatting
fmt = craneLib.cargoFmt {
inherit src;
};
# Audit dependencies
audit = craneLib.cargoAudit {
inherit src advisory-db;
};
# Audit dependencies
audit = craneLib.cargoAudit {
inherit src advisory-db;
};
# Audit licenses
deny = craneLib.cargoDeny {
inherit src;
};
# Audit licenses
deny = craneLib.cargoDeny {
inherit src;
};
# Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice
nextest = craneLib.cargoNextest (commonArgs // {
# Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice
nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
});
};
};
packages = {
packages =
{
default = crate;
} // pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // {
inherit cargoArtifacts;
});
}
// pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs
// {
inherit cargoArtifacts;
});
};
apps.default = flake-utils.lib.mkApp {
drv = crate;
};
apps.default = flake-utils.lib.mkApp {
drv = crate;
};
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
# Enable after Cargo.toml and Cargo.lock are present
# Consider customizing deny.toml
# checks = self.checks.${system};
devShells.default = craneLib.devShell {
# Inherit inputs from checks.
# Enable after Cargo.toml and Cargo.lock are present
# Consider customizing deny.toml
# checks = self.checks.${system};
# Extra inputs can be added here; cargo and rustc are provided by default
packages = [
fenixPkgs.rust-analyzer
];
RUST_SRC_PATH = "${fenixPkgs.complete.rust-src}/lib/rustlib/src/rust/library";
};
});
# Extra inputs can be added here; cargo and rustc are provided by default
packages = [
fenixPkgs.rust-analyzer
];
RUST_SRC_PATH = "${fenixPkgs.complete.rust-src}/lib/rustlib/src/rust/library";
};
});
}

View file

@ -4,12 +4,16 @@
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [ typst ];
};
});
outputs = {
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [typst];
};
});
}