srx.astro.nix/flake.nix
Sebastian Wendel 87ecf5ad32
first commit
2022-12-22 23:31:21 +01:00

91 lines
2.3 KiB
Nix

{
description = "srx.nix.astro";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
pre-commit-hooks,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = flake-utils.lib.cleanSource ./.;
hooks = {
alejandra.enable = true;
nix-linter.enable = true;
statix .enable = true;
};
settings.nix-linter.checks = [
"DIYInherit"
"EmptyInherit"
"EmptyLet"
"EtaReduce"
"LetInInheritRecset"
"ListLiteralConcat"
"NegateAtom"
"SequentialLet"
"SetLiteralUpdate"
"UnfortunateArgName"
"UnneededRec"
"UnusedArg"
"UnusedLetBind"
"UpdateEmptySet"
"BetaReduction"
"EmptyVariadicParamSet"
"UnneededAntiquote"
"no-FreeLetInFunc"
"no-AlphabeticalArgs"
"no-AlphabeticalBindings"
];
};
};
devShell = with pkgs;
mkShell {
name = "srx.nix.astro";
nativeBuildInputs = with pkgs; [
alejandra
editorconfig-checker
git
nix-linter
pre-commit
rnix-lsp
vscodium-fhs
yarn
nodejs
];
postInstall = '''';
shellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
hydraJobs = {};
# packages.default = self.packages.${system};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.allowAliases = true;
};
}
);
}