DEVELOPMENT ENVIRONMENT

~liljamo/nix-arta

ref: efee9ce31486e5789eb487ab469e7015631458cd nix-arta/flake.nix -rw-r--r-- 1.2 KiB
efee9ce3Jonni Liljamo feat: reduce root flake.nix to just a devshell 11 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    flake-parts = {
      url = "github:hercules-ci/flake-parts";
      inputs.nixpkgs-lib.follows = "nixpkgs";
    };

    git-hooks = {
      url = "github:cachix/git-hooks.nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    # Own flakes
    tamma.url = "git+https://git.src.quest/~liljamo/tamma?ref=refs/tags/0.1.2";
  };

  outputs = inputs @ {self, ...}:
    inputs.flake-parts.lib.mkFlake {inherit inputs;} {
      systems = ["x86_64-linux"];
      perSystem = {
        pkgs,
        system,
        ...
      }: {
        checks.pre-commit-check = inputs.git-hooks.lib.${system}.run {
          src = ./.;
          hooks = {
            alejandra = {
              enable = true;
            };
          };
        };

        devShells.default = pkgs.mkShell {
          inherit (self.checks.${system}.pre-commit-check) shellHook;
          buildInputs = with pkgs;
            [
              alejandra
              nix-diff
              sops
            ]
            ++ [
              inputs.tamma.packages.${system}.default
            ]
            ++ self.checks.${system}.pre-commit-check.enabledPackages;
        };
      };
    };
}