Commit Graph

51 Commits

Author SHA1 Message Date
53f35dc91c Make mkFlake extensible with additional modules
This is intended to allow flakes implementing a flakelight module to
export a mkFlake that automatically includes its module.
2023-09-13 22:39:20 -07:00
62083df539 Add functor option for flake's __functor attribute
This allows for conveniently making flakes callable.

Setting this is expected to be uncommon in general, but having the
option is useful as flakelight module flakes can use this to reduce the
boilerplate in using them.
2023-09-13 21:02:39 -07:00
838e383c50 Export autoImportArgs to modules 2023-08-27 00:01:48 -07:00
b8d9538c58 Rename project from flakelite to flakelight 2023-08-26 22:48:57 -07:00
f6c4424f6e Reimplement framework using the module system 2023-08-26 22:39:28 -07:00
50c4ad5cff Fix devShell attributes added at wrong level 2023-07-02 11:42:23 -07:00
412add2d01 Remove automatic use of ./. as nixDir
Using ./. as nixDir can cause confusion on repos with unrelated
directories that get picked up inadvertently.
2023-06-29 22:05:23 -07:00
af3e7f7a6f Add nixpkgsConfig to allow configuring nixpkgs 2023-05-13 20:05:21 -07:00
d871fd7cbf Use src as default nixDir if ./nix does not exist 2023-04-22 13:34:03 -07:00
f4f7a8cd37 Add aliases for autoloading root module attrs 2023-04-22 13:33:19 -07:00
f9967894bb Add support for home-manager outputs 2023-04-22 11:13:33 -07:00
7940d0c53f Add inputs and inputs' to top level of pkgs overlay 2023-04-22 10:13:01 -07:00
2c6954f018 Fix default nixDir path 2023-04-22 10:12:41 -07:00
bd68bc5c44 Make flakelite a functor as a shortcut for mkFlake 2023-04-20 19:29:56 -07:00
59ccd592a3 Allow outputs to be a functor
Previously, if outputs was a functor, it would mistakenly get called by
recUpdateSets.
2023-04-20 18:45:31 -07:00
76eb12e51b Allow root module to be a function 2023-04-20 18:26:39 -07:00
c9b8d986e1 Allow formatters to be functions 2023-04-16 18:37:32 -07:00
1c8ac213b0 Split up builtinModule into multiple modules 2023-04-16 16:31:17 -07:00
9c40724207 Have devShell install git pre-commit hook 2023-04-16 13:22:21 -07:00
07e68ac51b Allow check attributes to be functions that take pkgs 2023-04-16 11:33:19 -07:00
03cdbbabdf Add shellHook attr to configure default devShell 2023-04-16 11:20:28 -07:00
7509ce4110 Add comments 2023-04-16 00:55:45 -07:00
9e3bb803c6 Add default value for flakelite input 2023-04-15 20:11:34 -07:00
53843042f2 Apply some cleanup 2023-04-15 19:08:36 -07:00
b9ee864785 Add inputs module attribute for setting default inputs 2023-04-15 18:05:20 -07:00
76c6ec7938 Call per-system attributes with callFn 2023-04-15 16:59:02 -07:00
7149d4b655 Use callFn for modules and nonSysArgs 2023-04-15 16:33:46 -07:00
55493becb8 Refactoring and naming cleanup 2023-04-15 14:11:38 -07:00
bafb3c33ec Make raw root module available under root'.raw 2023-04-15 11:21:05 -07:00
aa0a3b3c2e Change file escape char to _ 2023-04-15 11:02:06 -07:00
3136d8e860 Add singular nixosModule and template 2023-04-15 06:36:46 -07:00
e33400c88c Improve app handling
Adds app attr for default app and allows apps to be functions like
packages and devShells.
2023-04-15 06:25:35 -07:00
28d5f5a5b4 Ensure normalized root has nixDir set 2023-04-15 05:10:53 -07:00
7d6c750790 Export more lib functions for use in modules 2023-04-15 05:00:19 -07:00
bbe8e3a442 Export autoloadAttr 2023-04-15 04:41:27 -07:00
867bf2ba6e Only autoload from ./nix or dir specified by nixDir 2023-04-15 04:18:54 -07:00
58503515fb Automatically find and load nix files for flake attrs 2023-04-15 04:09:23 -07:00
ec3ce2b4aa Skip default.nix in loadNixDir
This will allow a default.nix to use loadNixDir to load its directory.
2023-04-15 02:20:26 -07:00
426480067c Allow escaping nix filenames with +
This allows having a dir for which loadNixDir generates a "default" attr
without making the dir importable, by naming the file `+default.nix`
instead of `default.nix`.
2023-04-15 01:45:39 -07:00
b2d353f042 Support devShells and overriding default devShell 2023-04-15 01:29:54 -07:00
b2721d44d5 Extend package calling to allow single pkgs arg or no args 2023-04-15 01:26:00 -07:00
2775ef4d94 Fix mkApp
Using lib.getExe makes mkApp not work for derivations that are files.
Thus, this makes it so that the derivation is used as is. If an
executable in the derivation's directory is needed, a string path can be
used.
2023-04-14 21:05:40 -07:00
b1fe8e8e17 Apply optional parameters to non-per-system attrs
This allows attrs that previously did not take args to receive args
including the flakelite lib attrs and module parameters.

`withOverlay` and `withPackage` are excluded as it would be ambiguous
since those are already functions. They are also short forms; if args
are needed, the regular plural attr can be used.

These args are also added to the flakelite pkgs attr for per-system
attrs to take advantage of.
2023-04-14 20:24:43 -07:00
cd655770d6 Add checks for nixosConfigurations outputs 2023-04-14 20:07:06 -07:00
8f3827c45c Move inputs and inputs' pkgs attrs into flakelite attr
This will prevent name collisions, and be more cohesive as more is added
to the flakelite attr.
2023-04-14 18:41:08 -07:00
7c903add3f Make inputs and inputs' available in pkgs arg
This allows functions with access only to pkgs to access the flake inputs. The
inputs' arg allows easy access to per system attributes.
2023-04-14 10:44:05 -07:00
5fbb85744b Add default formatting for json and yaml files 2023-04-14 10:43:39 -07:00
7e73ee23d6 Make flakelite lib attrs available in flakelite pkgs attr 2023-04-14 10:42:50 -07:00
e91836b9d3 Skip conversion of app attributes if they are already apps 2023-04-13 22:57:23 -07:00
dab3eb948d Make output packages available in all pkgs parameters
This enables using packages defined by the flake from the pkgs input of apps,
for example.
2023-04-13 19:19:58 -07:00