Initial commit
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
{
|
||||
description = "Generic starter template for future projects";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
in
|
||||
{
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
git
|
||||
git-lfs
|
||||
tea
|
||||
openssh
|
||||
gnupg
|
||||
alejandra
|
||||
deadnix
|
||||
statix
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
nix-format = pkgs.runCommand "nix-format-check" { nativeBuildInputs = [ pkgs.alejandra ]; } ''
|
||||
cd ${self}
|
||||
alejandra --check .
|
||||
touch "$out"
|
||||
'';
|
||||
|
||||
nix-lint =
|
||||
pkgs.runCommand "nix-lint-check"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
pkgs.deadnix
|
||||
pkgs.statix
|
||||
];
|
||||
}
|
||||
''
|
||||
cd ${self}
|
||||
deadnix .
|
||||
statix check .
|
||||
touch "$out"
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user