mirror of
https://github.com/eza-community/eza.git
synced 2025-07-07 19:35:33 +00:00

• Updated input 'naersk': 'github:nix-community/naersk/38a563a865a0218d9f30f14333327aafc40eea75' (2025-01-07) → 'github:nix-community/naersk/0621e47bd95542b8e1ce2ee2d65d6a1f887a13ce' (2025-01-09) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/8c9fd3e564728e90829ee7dbac6edc972971cd0f' (2025-01-07) → 'github:NixOS/nixpkgs/0bd024d34eb07cef235f94258423f40a41182088' (2025-01-15) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/a0b81d4fa349d9af1765b0f0b4a899c13776f706' (2025-01-08) → 'github:oxalica/rust-overlay/848db855cb9e88785996e961951659570fc58814' (2025-01-16) Signed-off-by: Christina Sørensen <ces@fem.gg>
193 lines
4.8 KiB
Nix
193 lines
4.8 KiB
Nix
# SPDX-FileCopyrightText: 2024 Christina Sørensen
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
#
|
|
# SPDX-FileCopyrightText: 2014-2024 Christina Sørensen, eza contributors
|
|
# SPDX-License-Identifier: MIT
|
|
{
|
|
description = "eza: a modern, maintained replacement for ls";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
systems.url = "github:nix-systems/default";
|
|
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs = {
|
|
systems.follows = "systems";
|
|
};
|
|
};
|
|
|
|
naersk = {
|
|
url = "github:nix-community/naersk";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
treefmt-nix = {
|
|
url = "github:numtide/treefmt-nix";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
powertest = {
|
|
url = "github:eza-community/powertest";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
flake-utils.follows = "flake-utils";
|
|
naersk.follows = "naersk";
|
|
treefmt-nix.follows = "treefmt-nix";
|
|
rust-overlay.follows = "rust-overlay";
|
|
};
|
|
};
|
|
|
|
pre-commit-hooks = {
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
advisory-db = {
|
|
url = "github:rustsec/advisory-db";
|
|
flake = false;
|
|
};
|
|
};
|
|
outputs =
|
|
{
|
|
self,
|
|
flake-utils,
|
|
naersk,
|
|
nixpkgs,
|
|
treefmt-nix,
|
|
rust-overlay,
|
|
powertest,
|
|
pre-commit-hooks,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
|
|
pkgs = (import nixpkgs) {
|
|
inherit system overlays;
|
|
};
|
|
|
|
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
|
|
|
naersk' = pkgs.callPackage naersk {
|
|
cargo = toolchain;
|
|
rustc = toolchain;
|
|
clippy = toolchain;
|
|
};
|
|
|
|
treefmtEval = treefmt-nix.lib.evalModule pkgs .config/treefmt.nix;
|
|
|
|
darwinBuildInputs = pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
|
pkgs.libiconv
|
|
pkgs.darwin.apple_sdk.frameworks.Security
|
|
];
|
|
|
|
buildInputs = [ pkgs.zlib ] ++ darwinBuildInputs;
|
|
in
|
|
rec {
|
|
# For `nix fmt`
|
|
formatter = treefmtEval.config.build.wrapper;
|
|
|
|
packages = {
|
|
default = import ./nix/eza.nix { inherit pkgs naersk' buildInputs; };
|
|
|
|
check = naersk'.buildPackage {
|
|
inherit buildInputs;
|
|
src = ./.;
|
|
mode = "check";
|
|
};
|
|
|
|
test = naersk'.buildPackage {
|
|
inherit buildInputs;
|
|
src = ./.;
|
|
mode = "test";
|
|
};
|
|
|
|
clippy = naersk'.buildPackage {
|
|
inherit buildInputs;
|
|
src = ./.;
|
|
mode = "clippy";
|
|
};
|
|
} // (import ./nix/trycmd.nix { inherit pkgs naersk' buildInputs; });
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
nativeBuildInputs =
|
|
with pkgs;
|
|
[
|
|
# cargo
|
|
# clippy
|
|
rustup
|
|
toolchain
|
|
just
|
|
pandoc
|
|
convco
|
|
zip
|
|
reuse
|
|
|
|
# For releases
|
|
b3sum
|
|
cargo-bump
|
|
|
|
# For generating demo
|
|
vhs
|
|
|
|
powertest.packages.${pkgs.system}.default
|
|
|
|
cargo-hack
|
|
cargo-udeps
|
|
cargo-outdated
|
|
]
|
|
++ darwinBuildInputs;
|
|
};
|
|
|
|
checks = {
|
|
pre-commit-check =
|
|
let
|
|
toFilter = [
|
|
"yamlfmt"
|
|
"nixfmt"
|
|
"taplo"
|
|
"shellcheck" # this doesn't respect our excludes:w
|
|
];
|
|
filterFn = n: _v: (!builtins.elem n toFilter);
|
|
treefmtFormatters = pkgs.lib.mapAttrs (_n: v: { inherit (v) enable; }) (
|
|
pkgs.lib.filterAttrs filterFn (import .config/treefmt.nix).programs
|
|
);
|
|
in
|
|
pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = treefmtFormatters // {
|
|
nixfmt-rfc-style.enable = true;
|
|
convco.enable = true;
|
|
reuse = {
|
|
enable = true;
|
|
name = "reuse";
|
|
entry = with pkgs; "${reuse}/bin/reuse lint";
|
|
pass_filenames = false;
|
|
};
|
|
};
|
|
};
|
|
formatting = treefmtEval.config.build.check self;
|
|
build = packages.check;
|
|
inherit (packages)
|
|
default
|
|
test
|
|
trycmd
|
|
;
|
|
lint = packages.clippy;
|
|
};
|
|
}
|
|
);
|
|
}
|