2021-05-29 10:19:31 +03:00
|
|
|
{
|
|
|
|
description = "A faster, persistent implementation of `direnv`'s `use_nix`, to replace the built-in one.";
|
2023-12-20 10:19:19 +03:00
|
|
|
|
|
|
|
nixConfig.extra-substituters = [ "https://cache.thalheim.io" ];
|
|
|
|
nixConfig.extra-trusted-public-keys = [ "cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc=" ];
|
|
|
|
|
2023-12-14 20:55:33 +03:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
flake-parts = {
|
|
|
|
url = "github:hercules-ci/flake-parts";
|
|
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
treefmt-nix = {
|
|
|
|
url = "github:numtide/treefmt-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
2021-05-29 10:19:31 +03:00
|
|
|
|
2023-11-29 09:13:11 +03:00
|
|
|
outputs = inputs @ { flake-parts, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; }
|
|
|
|
({ lib, ... }: {
|
2023-12-21 12:23:04 +03:00
|
|
|
imports = [
|
|
|
|
./treefmt.nix
|
|
|
|
./pkgs/bash4/flake-module.nix
|
|
|
|
];
|
2023-11-29 09:13:11 +03:00
|
|
|
systems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
|
|
|
perSystem = { config, pkgs, self', ... }: {
|
2023-05-23 16:47:34 +03:00
|
|
|
packages = {
|
2023-11-29 09:13:11 +03:00
|
|
|
nix-direnv = pkgs.callPackage ./default.nix { };
|
|
|
|
default = config.packages.nix-direnv;
|
2023-05-23 18:21:25 +03:00
|
|
|
test-runner-stable = pkgs.callPackage ./test-runner.nix {
|
|
|
|
nixVersion = "stable";
|
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
test-runner-unstable = pkgs.callPackage ./test-runner.nix {
|
2023-05-23 18:21:25 +03:00
|
|
|
nixVersion = "unstable";
|
|
|
|
};
|
2023-12-21 11:31:05 +03:00
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
|
2023-12-21 11:31:05 +03:00
|
|
|
devShells.default = pkgs.callPackage ./shell.nix {
|
|
|
|
packages = [ config.treefmt.build.wrapper ];
|
2023-12-20 10:19:19 +03:00
|
|
|
};
|
2023-12-21 11:31:05 +03:00
|
|
|
|
|
|
|
checks =
|
|
|
|
let
|
|
|
|
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
|
|
|
|
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
|
|
|
|
in
|
|
|
|
packages // devShells;
|
2023-11-29 09:13:11 +03:00
|
|
|
};
|
|
|
|
flake = {
|
2023-11-29 15:48:27 +03:00
|
|
|
overlays.default = final: _prev: {
|
2023-11-29 09:13:11 +03:00
|
|
|
nix-direnv = final.callPackage ./default.nix { };
|
2023-05-23 16:47:34 +03:00
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
templates.default = {
|
|
|
|
path = ./templates/flake;
|
|
|
|
description = "nix flake new -t github:Mic92/nix-direnv .";
|
2023-05-23 16:47:34 +03:00
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
};
|
|
|
|
});
|
2021-05-29 10:19:31 +03:00
|
|
|
}
|