Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions modules/nixlock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
inherit (config) flake-file;
inherit (import ../lib.nix lib) inputsExpr;

inputs = flake-file.nixlock.preProcess (inputsExpr flake-file.inputs);
inputs = flake-file.preProcess (inputsExpr flake-file.inputs);

nixlock-source = fetchTarball {
url = flake-file.nixlock.url;
Expand Down Expand Up @@ -166,10 +166,5 @@ in
description = "nixlock custom input types";
default = { };
};
preProcess = lib.mkOption {
type = lib.types.functionTo lib.types.raw;
description = "Pre-process flake-file inputs before giving to nixlock";
default = lib.id;
};
};
}
2 changes: 1 addition & 1 deletion modules/npins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
inherit (config) flake-file;
inherit (import ../lib.nix lib) inputsExpr;

inputs = inputsExpr flake-file.inputs;
inputs = flake-file.preProcess (inputsExpr flake-file.inputs);

# Synthesise a canonical URL from attrset-form inputs (no url field).
gitHostScheme = { github = "github"; gitlab = "gitlab"; sourcehut = "sourcehut"; };
Expand Down
2 changes: 1 addition & 1 deletion modules/write-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ let

flakeInputs = "inputs = ${
nixCode {
expr = inputsExpr flake-file.inputs;
expr = flake-file.preProcess (inputsExpr flake-file.inputs);
styles = [
{
attrSortPriority = sortPriority.inputs;
Expand Down
8 changes: 7 additions & 1 deletion modules/write-inputs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
# DO-NOT-EDIT: Generated by github:vic/flake-file.
# To re-generate use: nix-shell . -A flake-file.sh --run write-inputs
''
+ (nixCode { expr = inputsExpr flake-file.inputs; });
+ (nixCode { expr = flake-file.preProcess (inputsExpr flake-file.inputs); });

inputsFile =
pkgs:
Expand Down Expand Up @@ -77,5 +77,11 @@ in
visible = false;
default = shell flake-file.pkgs;
};

preProcess = lib.mkOption {
type = lib.types.functionTo lib.types.raw;
description = "Pre-process flake-file inputs before giving to backend";
default = lib.id;
};
};
}
Loading