summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 5351034163eb8babe54329e3eabb6a9d21d9b2ae (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
  description = "seth's website";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flake-checks.url = "github:getchoo/flake-checks";
  };

  outputs =
    {
      self,
      nixpkgs,
      flake-checks,
    }:
    let
      inherit (nixpkgs) lib;
      systems = [
        "x86_64-linux"
        "aarch64-linux"
        "x86_64-darwin"
        "aarch64-darwin"
      ];

      forAllSystems = lib.genAttrs systems;
      nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system});
    in
    {
      checks = forAllSystems (
        system:
        let
          flake-checks' = flake-checks.lib.mkChecks {
            root = ./.;
            pkgs = nixpkgsFor.${system};
          };
        in
        {
          inherit (flake-checks')
            actionlint
            alejandra
            deadnix
            statix
            ;
        }
      );

      devShells = forAllSystems (system: {
        default = import ./shell.nix {
          inherit system;
          pkgs = nixpkgsFor.${system};
          formatter = self.formatter.${system};
        };
      });

      formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style);

      packages = forAllSystems (
        system:
        let
          pkgs' = import ./. {
            inherit system;
            pkgs = nixpkgsFor.${system};
          };
        in
        pkgs' // { default = pkgs'.website; }
      );
    };
}