lib: working extended lib

This commit is contained in:
Charlie Root 2024-08-30 23:15:56 +02:00
commit 7063ef40d9
3 changed files with 8 additions and 36 deletions

View file

@ -1,36 +1,10 @@
{
inputs,
lib,
withSystem,
inputs,
...
}: let
# inherit (inputs) self;
# inherit (inputs.nixpkgs) lib;
inherit (lib.builders) mkSystem;
# mkSystem = {
# withSystem,
# system,
# ...
# } @ args:
# withSystem system (
# {
# inputs',
# self',
# ...
# }:
# lib.nixosSystem {
# inherit system;
# specialArgs =
# lib.recursiveUpdate
# {
# inherit lib;
# inherit inputs inputs';
# inherit self self';
# }
# (args.specialArgs or {});
# inherit (args) modules;
# }
# );
inherit (inputs.self) lib;
inherit (lib.extendedLib.builders) mkSystem;
in {
flake.nixosConfigurations = {
temperance = mkSystem {

View file

@ -1,9 +1,6 @@
{
inputs,
lib,
...
}: let
inherit (inputs) self;
{inputs, ...}: let
inherit (inputs) self nixpkgs;
inherit (nixpkgs) lib;
in {
mkSystem = {
withSystem,

View file

@ -19,12 +19,13 @@
builders = callLibs ./builders.nix;
};
# This makes mkSysytem available *in addition* to `lib.extendedLib.builders.mkSystem`.
# This makes mkSytem available *in addition* to `lib.extendedLib.builders.mkSystem`.
# The syntax is a matter of preference, but it is good to make sure all custom attribute
# sets (e.g., builders) are defined and taken from a separate attrset (extendedLib) to make
# absolutely sure we *never* conflict with nixpkgs. Likewise, the function names inherited
# here should also be different from ones available under `lib` by default, i.e., you cannot
# re-define functions.
inherit (self.extendedLib) builders;
inherit (self.extendedLib.builders) mkSystem;
};