sourcegraph/flake.nix
Noah S-C 9f7df7ca07
nix: set formatter & use nil instead of rnix-lsp (#51409)
Allows formatting everything with `nix fmt`

[nil](https://github.com/oxalica/nil) appears more maintained and higher
quality than rnix-lsp

## Test plan

N/A, nix stuff
2023-05-03 12:56:44 +00:00

32 lines
1.1 KiB
Nix

{
description = "The Sourcegraph developer environment & packages Nix Flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
with nixpkgs.lib; with utils.lib; {
devShells = genAttrs defaultSystems (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.ctags ]; };
in
{
default = pkgs.callPackage ./shell.nix { };
}
);
formatter = genAttrs defaultSystems (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt);
# Pin a specific version of universal-ctags to the same version as in cmd/symbols/ctags-install-alpine.sh.
overlays.ctags = (import ./dev/nix/ctags.nix { inherit nixpkgs utils; inherit (nixpkgs) lib; }).overlay;
packages = fold recursiveUpdate { } [
((import ./dev/nix/ctags.nix { inherit nixpkgs utils; inherit (nixpkgs) lib; }).packages)
(import ./dev/nix/p4-fusion.nix { inherit nixpkgs utils; inherit (nixpkgs) lib; })
(import ./dev/nix/comby.nix { inherit nixpkgs utils; inherit (nixpkgs) lib; })
];
};
}