summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 5f786a45e8e160400792343184b8d0b1eacf3db5 (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
68
{
  description = "Source code of Quentin Aristote's personal webpage.";

  inputs = {
    data.url = "github:qaristote/info";
    devenv.url = "github:cachix/devenv";
    my-nixpkgs.url = "github:qaristote/my-nixpkgs";
    uncss = {
      url = "github:qaristote/uncss";
      inputs = {
        nixpkgs.follows = "/nixpkgs";
      };
    };
    nixpkgs = {};
  };

  nixConfig = {
    extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
    extra-trusted-substituters = "https://devenv.cachix.org";
  };

  outputs = {
    flake-parts,
    my-nixpkgs,
    ...
  } @ inputs:
    flake-parts.lib.mkFlake {inherit inputs;} ({
      self,
      lib,
      ...
    }: {
      imports = builtins.attrValues {inherit (my-nixpkgs.flakeModules) personal devenv;};

      flake.lib = import ./lib {inherit lib;};

      perSystem = {
        self',
        pkgs,
        system,
        ...
      }: {
        packages = let
          pkgsLocal = import ./pkgs {inherit pkgs;};
          pkgs' = pkgs.extend (
            _: _:
              pkgsLocal // {uncss = inputs.uncss.packages."${system}".default;}
          );
          html = self.lib.pp.html;
        in
          pkgsLocal
          // {
            default = self'.packages.webpage;
            webpage = import ./default.nix {
              inherit html;
              pkgs = pkgs';
              data = inputs.data.lib.formatWith {
                inherit pkgs;
                markup = html;
              };
            };
          };
        devenv.shells.default = {
          languages.nix.enable = true;
          packages = [pkgs.miniserve];
        };
      };
    });
}