summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 211c0c910bff01431e516906121461870b20dce2 (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
{
  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 = {};
  };

  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
          pkgs' = pkgs.extend (
            _: _: {
              uncss = inputs.uncss.packages."${system}".default;
              line-awesome-css = my-nixpkgs.packages."${system}".static_css_lineAwesome;
            }
          );
          html = self.lib.pp.html;
        in {
          default = self'.packages.webpage;
          webpage = import ./default.nix {
            inherit html;
            pkgs = pkgs';
            data = inputs.data.lib.formatWith {
              inherit pkgs;
              markup = html;
            };
          };
        };
        devenv.shells.default = {
          imports = [my-nixpkgs.devenvModules.personal];
          languages.nix.enable = true;
          packages = [pkgs.miniserve];
        };
      };
    });
}