{ 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 ({ inherit self; } // 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; }; 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