Merge branch 'main' into moduleLocation

This commit is contained in:
Yang, Bo 2023-07-22 18:07:20 -07:00 committed by GitHub
commit f359432597
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 443 additions and 85 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
@ -17,11 +17,6 @@ let
getExe = x:
"${lib.getBin x}/bin/${x.meta.mainProgram or (throw ''Package ${x.name or ""} does not have meta.mainProgram set, so I don't know how to find the main executable. You can set meta.mainProgram, or pass the full path to executable, e.g. program = "''${pkg}/bin/foo"'')}";
getBin = x:
if !x?outputSpecified || !x.outputSpecified
then x.bin or x.out or x
else x;
appType = lib.types.submodule {
options = {
type = mkOption {

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption

View file

@ -10,9 +10,6 @@ let
inherit (flake-parts-lib)
mkPerSystemOption
;
inherit (builtins)
removeAttrs
;
mkDebugConfig = { config, options, extendModules }: config // {
inherit config;

View file

@ -1,8 +1,9 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
types
literalExpression
;
inherit (flake-parts-lib)
mkTransposedPerSystemModule
@ -17,6 +18,13 @@ mkTransposedPerSystemModule {
An attribute set of packages to be used as shells.
[`nix develop .#<name>`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html) will run `devShells.<name>`.
'';
example = literalExpression ''
{
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ wget bat cargo ];
};
}
'';
};
file = ./devShells.nix;
}

View file

@ -1,10 +1,7 @@
{ config, lib, ... }:
{ lib, ... }:
let
inherit (lib)
filterAttrs
mapAttrs
mkOption
optionalAttrs
types
;
in

View file

@ -24,7 +24,7 @@ in
};
};
perSystem = mkPerSystemOption ({ config, ... }: {
perSystem = mkPerSystemOption {
_file = ./formatter.nix;
options = {
formatter = mkOption {
@ -35,7 +35,7 @@ in
'';
};
};
});
};
};
config = {
flake.formatter =

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption

View file

@ -1,4 +1,4 @@
{ config, lib, withSystem, ... }:
{ withSystem, ... }:
{
config = {
_module.args = {

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption

View file

@ -1,10 +1,8 @@
{ config, self, lib, flake-parts-lib, moduleLocation, ... }:
{ self, lib, flake-parts-lib, moduleLocation, ... }:
let
inherit (lib)
filterAttrs
mapAttrs
mkOption
optionalAttrs
types
;
inherit (flake-parts-lib)

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
@ -16,7 +16,7 @@ in
# also update description when done
type = types.lazyAttrsOf (types.uniq (types.functionTo (types.functionTo (types.lazyAttrsOf types.unspecified))));
# This eta expansion exists for the sole purpose of making nix flake check happy.
apply = lib.mapAttrs (k: f: final: prev: f final prev);
apply = lib.mapAttrs (_k: f: final: prev: f final prev);
default = { };
example = lib.literalExpression or lib.literalExample ''
{

View file

@ -1,4 +1,4 @@
{ config, lib, flake-parts-lib, ... }:
{ lib, flake-parts-lib, ... }:
let
inherit (lib)
mkOption

View file

@ -7,10 +7,6 @@ let
mkOption
types
;
inherit (flake-parts-lib)
mkSubmoduleOptions
mkPerSystemOption
;
transpositionModule = {
options = {
@ -65,12 +61,9 @@ in
system: flake:
mapAttrs
(attrName: attrConfig: flake.${attrName}.${system})
(filterAttrs
(attrName: attrConfig: flake?${attrName}.${system})
config.transposition
);
config.transposition;
perSystem = { ... }: {
perSystem = {
options =
mapAttrs
(k: v: lib.mkOption { })

View file

@ -1,8 +1,6 @@
{ config, lib, flake-parts-lib, self, getSystem, ... }:
{ lib, flake-parts-lib, getSystem, ... }:
let
inherit (lib)
genAttrs
mapAttrs
mkOption
types
;
@ -12,7 +10,7 @@ let
in
{
options = {
perSystem = mkPerSystemOption ({ config, options, system, specialArgs, ... }: {
perSystem = mkPerSystemOption ({ config, options, specialArgs, ... }: {
_file = ./perSystem.nix;
options = {
allModuleArgs = mkOption {