1
0
Fork 0
nixos-config/flake-module.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2023-02-11 20:47:08 +00:00
{
inputs,
config,
...
}: {
2023-02-11 20:32:56 +00:00
imports = [
inputs.pre-commit-hooks.flakeModule
./nixos/flake-module.nix
./home-manager/flake-module.nix
./packages/flake-module.nix
./overlays/flake-module.nix
];
systems = ["x86_64-linux"];
perSystem = {
inputs',
lib,
2023-02-11 20:58:36 +00:00
config,
2023-02-11 20:32:56 +00:00
pkgs,
...
}: {
devShells = {
default = pkgs.mkShell {
shellHook = config.pre-commit.installationScript;
};
};
checks = {
system-checks = pkgs.recursiveLinkFarm "all-configs" {
2023-02-11 20:58:36 +00:00
nixos-configurations = lib.mapAttrs (_: config: config.config.system.build.toplevel) inputs.self.nixosConfigurations;
home-manager-configurations = inputs.self.homeModes;
2023-02-11 20:32:56 +00:00
};
};
pre-commit = {
pkgs = inputs'.nixos-unstable.legacyPackages;
check.enable = true;
settings = {
settings.ormolu.defaultExtensions = [
"TypeApplications"
"BangPatterns"
"ImportQualifiedPost"
"BlockArguments"
];
hooks = {
2023-03-07 11:20:49 +00:00
hlint.enable = true;
2023-02-11 20:32:56 +00:00
alejandra.enable = true;
nix-linter.enable = false; # Too many false positives for now
statix.enable = true;
fourmolu.enable = true;
shellcheck.enable = true;
cabal-fmt.enable = true;
dhall-format.enable = true;
};
};
};
};
}