Commit Graph

17 Commits

Author SHA1 Message Date
Archit Gupta
aaf1441ff7 Add hardeningDisable to devShell module 2024-10-30 21:52:12 -07:00
Archit Gupta
3a364f9cdd Remove checking of meta.platforms
Previously, meta.platforms would be checked for each package when
generating package attributes for a system, so that unsupported packages
would not have an output attribute. This commit removes that behavior.

Now `nix flake show` will succeed even if packages fail to evaluate on
other platforms. `nix flake show --all-systems` will still fail though.
2024-03-24 14:23:41 -07:00
Archit Gupta
fe5916eb40 Use submoduleWith instead of submodule
This results in not enabling shorthandOnlyDefinesConfig, allowing
imports to be set in submodules. This can, for example, allow a devShell
to import another devShell's config to extend it.
2024-03-21 04:12:42 -07:00
Archit Gupta
360fd2099d Allow devShells to be directly set to derivations 2024-02-25 18:44:31 -08:00
Archit Gupta
41ec64361f Allow using optFunctionTo on types with submodules 2024-02-24 21:31:24 -08:00
Archit Gupta
a50fbcba1a Allow all of devShells config types in devShells
`devShell` accepted either a package def, a submodule value, or a
function to a submodule value. `devShells` only accepted package defs.
This brings all the options of `devShells` to any devShell configured
with `devShells`.
2024-02-07 01:49:29 -08:00
Archit Gupta
543e3aaa4d Replace nixpkgs nullOr type with custom type
`nullOr`'s merge function requires definitions to all be null or all be
non-null. It was being used where the intent was that null be used as a
value representing unset, and as such the merge should return null if
all definitions are null and ignore nulls otherwise. This adds a type
with that merge semantics.
2024-02-07 01:49:29 -08:00
Archit Gupta
9fe4cb1994 Enable devShell as a function to take packages
Before, devShell could be set to a submodule config, a package def, or a
function taking module args and returning a submodule config. This
changes the last form to take the package set instead.

This enables cleaner configuration by not needing each option to
individually be a function of pkgs. Passing pkgs also gives more
flexibility as all the module args are available under the `moduleArgs`
attr.

Code that relied on module args not directly in the package set will now
have to access them from the `moduleArgs` attr.
2024-02-07 01:49:29 -08:00
Archit Gupta
589ee5ba7a Make direct and auto-loaded configuration consistent
Many attributes can take moduleArgs when auto-loaded in order to
facilitate access to them from other files. Those same attributes could
not take moduleArgs when included directly, which was inconsistent.

With this change, all attributes that could take moduleArgs when
auto-loaded can now always do so. Auto-loading no longer needs special
cases.
2024-01-14 19:35:54 -08:00
Archit Gupta
1d92662d82 Allow devShell to be a package def or take args
Previously, devShell was inconsistent when setting it to a function.
When setting directly, a function was assumed to be a package definition
and was used to set devShells.default directly. When auto-loading, a
function was assumed to take module args, and result in config (not a
derivation).

This now enables both behaviors in either case by detecting if a
function is a package definition or if it expects module args and
handling it accordingly.
2024-01-14 19:22:46 -08:00
Archit Gupta
82f9fe67c3 Improve performance of per-system attributes
Using `perSystem` to implement per-system attributes ties all the
per-system attributes together; all the `perSystem` functions must run
to determine output attrs. By generating them separately, the generation
can be done lazily.
2024-01-11 17:35:01 -08:00
Archit Gupta
8f3bfc39aa Allow devShell to be set to a package definition 2023-12-05 19:44:12 -08:00
Archit Gupta
dccabae216 Clean up devShell options
Using a submodule for devShell removes the need to make every option
nullable and the need to check all of them. By using nullOr submodule,
we can tell if the value has been set and have default values for
options.

This also enables enabling a devShell with no options set.
2023-12-05 01:29:42 -08:00
Archit Gupta
a4e4a341f2 Allow configuring the stdenv for devShell 2023-12-05 01:00:35 -08:00
Archit Gupta
e401f68030 Allow overriding of default devShell
This sets the default devShell using mkDefault, letting user set default
shells override it. Previously, to set a different default shell, one
would have to not set any of the devShell.* options and then define
devShells.default, or use mkForce.
2023-10-18 20:04:16 -07:00
Archit Gupta
b8d9538c58 Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
Archit Gupta
f6c4424f6e Reimplement framework using the module system 2023-08-26 22:39:28 -07:00