summaryrefslogtreecommitdiff
path: root/inputs.nix
blob: 8902303efe41ccad3228966d587cba705d100674 (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
{ system ? "x86_64-linux", sources ? import ./npins }:

let

  # some of my dependencies are only usable as flakes. this is just enough
  # nonsense to import these
  callFlake = name: inputs:
    let
      self = (import "${sources.${name}}/flake.nix").outputs
        ({ self = self // { outPath = sources.${name}.outPath; }; } // inputs);
    in
      self // { outPath = sources.${name}.outPath; };

  inputs = sources // rec {

    flake-utils = callFlake "flake-utils" { };

    deploy-rs = callFlake "deploy-rs" {
      # there's an implicit contract here that the module deploy-rs produces
      # will not depend on the nixpkgs it is given, but that works out
      inherit nixpkgs;
      utils = flake-utils;
    };

    # both copies of nixpkgs get // { outPath = }'d, so that the nixPath
    # override can use these paths.
    nixpkgs = import sources.nixpkgs {
      inherit system;
      overlays = [
        (import sources.rust-overlay)
        deploy-rs.overlay
        (import ./pkgs/overlay.nix { inherit inputs; })
        lix-overlay
      ];
    } // { outPath = sources.nixpkgs.outPath; };

    nixpkgs-unstable =
      import sources.nixpkgs-unstable { inherit system; }
      // { outPath = sources.nixpkgs-unstable.outPath; };

    # this absurd third copy only exists because non-flake nixpkgs does not
    # as easily expose the evalConfig function ..
    nixpkgs-flake =
      (import "${sources.nixpkgs}/flake.nix").outputs { self = nixpkgs-flake; }
      // { outPath = sources.nixpkgs.outPath; };

    home-manager = callFlake "home-manager" { inherit nixpkgs; };

    feeds = import /home/stuebinm/org/nonpublic.nix;

    sops-nix = import "${sources.sops-nix}/modules/sops";

    simple-nixos-mailserver = import sources.simple-nixos-mailserver;

    lix-overlay = import "${sources.lix-nixos-module}/overlay.nix" {
      lix = sources.lix;
    };
  };
in inputs