mirror of
https://github.com/nix-community/flakelight.git
synced 2024-11-26 01:13:11 +01:00
cecfafe9a4
If the `src` passed to flakelight contains a flake.lock, it will now be read and used to set defaults for `inputs`. Explicitly passed inputs will override this.
14 lines
473 B
Nix
14 lines
473 B
Nix
# flakelight -- Framework for simplifying flake setup
|
|
# Copyright (C) 2023 Archit Gupta <archit@accelbread.com>
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
{ lib, src, ... }:
|
|
let
|
|
inherit (builtins) mapAttrs pathExists;
|
|
inherit (lib) mkOverride;
|
|
lock2inputs = import ../misc/lock2inputs.nix { inherit lib; };
|
|
lockFound = pathExists (src + "/flake.lock");
|
|
autoInputs = if lockFound then lock2inputs src else { };
|
|
in
|
|
{ config.inputs = mapAttrs (_: mkOverride 950) autoInputs; }
|