nix-direnv/flake.nix

67 lines
2.1 KiB
Nix
Raw Normal View History

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=" ];
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, ... }: {
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-11-29 09:13:11 +03:00
devShells.default = pkgs.callPackage ./shell.nix {
2024-04-19 22:54:50 +03:00
packages = [ config.treefmt.build.wrapper pkgs.shellcheck ];
2023-12-20 10:19:19 +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 = {
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
}