about summary refs log tree commit diff
path: root/flake.nix
blob: e9f1a019a27ed34f843767af03e7f977d29fe5c7 (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
{
  description = "exotic.sh system flake";

  inputs = {
    unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    unstable-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
    nixpkgs-2111.url = "github:nixos/nixpkgs/nixos-21.11";

    nixpkgs-exotic.url = "git+https://git.exotic.sh/nixpkgs-exotic";

    colmena.url = "github:zhaofengli/colmena";
    colmena.inputs.nixpkgs.follows = "unstable";

    flake-compat.url = "github:edolstra/flake-compat";
    flake-compat.flake = false;

    impermanence.url = "github:nix-community/impermanence";

    authentik-nix.url = "github:nix-community/authentik-nix";
    authentik-nix.inputs.nixpkgs.follows = "unstable";

    sops-nix.url = "github:Mic92/sops-nix";
    sops-nix.inputs.nixpkgs.follows = "unstable";

    nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
    nixos-mailserver.inputs.nixpkgs.follows = "unstable";

    sefidel-web.url = "git+https://git.exotic.sh/pub/sefidel/sefidel-web";
  };

  outputs = { self, unstable, ... } @ inputs:
    let
      inherit (lib.my) mapModulesRec mapSystems;

      system = "x86_64-linux";

      pkgs = import unstable { inherit system; overlays = [ inputs.nixpkgs-exotic.overlays.default ]; };

      lib = unstable.lib.extend
        (self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });
    in
    {
      lib = lib.my;

      nixosModules = mapModulesRec ./modules import;

      nixosConfigurations = mapSystems ./systems { };

      colmena = self.lib.mkColmenaFromNixOSConfigurations self.nixosConfigurations;

      hydraJobs = self.lib.mkHydraFromNixOSConfigurations self.nixosConfigurations;
   };
}