mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
lib: restructure folder structure
To easily support channels and flake.
This commit is contained in:
parent
9e170dd6ec
commit
a5ababe88d
@ -1,8 +1,7 @@
|
|||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
let
|
let
|
||||||
lib' = pkgs.lib.extend (final: prev:
|
lib' = pkgs.lib.extend (import ./lib/extras/extend-lib.nix);
|
||||||
import ./lib { lib = prev; } // import ./lib/private.nix { lib = final; });
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib = import ./lib { lib = pkgs.lib; };
|
lib = import ./lib { lib = pkgs.lib; };
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
users = lib'.importTOML ./users.toml;
|
users = lib'.importTOML ./users.toml;
|
||||||
|
|
||||||
# A set of image-related utilities for the flake outputs.
|
# A set of image-related utilities for the flake outputs.
|
||||||
inherit (import ./lib/images.nix { inherit inputs; lib = lib'; }) mkHost mkHome mkImage listImagesWithSystems;
|
inherit (import ./lib/extras/images.nix { inherit inputs; lib = lib'; }) mkHost mkHome mkImage listImagesWithSystems;
|
||||||
|
|
||||||
# The order here is important(?).
|
# The order here is important(?).
|
||||||
overlays = [
|
overlays = [
|
||||||
|
16
lib/extras/extend-lib.nix
Normal file
16
lib/extras/extend-lib.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# A lambda suitable to be used for `pkgs.lib.extend`.
|
||||||
|
self: super: let
|
||||||
|
publicLib = import ../. { lib = super; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit (publicLib) filesToAttr countAttrs getSecrets
|
||||||
|
attachSopsPathPrefix;
|
||||||
|
|
||||||
|
# Until I figure out how to properly add them only for their respective
|
||||||
|
# environment, this is the working solution for now. Not really perfect
|
||||||
|
# since we use one nixpkgs instance for each configuration (home-manager or
|
||||||
|
# otherwise).
|
||||||
|
private = publicLib
|
||||||
|
// import ../private.nix { lib = self; }
|
||||||
|
// import ../home-manager.nix { lib = self; };
|
||||||
|
}
|
@ -4,15 +4,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
# A function that generates a lambda suitable for `lib.extend`.
|
# A function that generates a lambda suitable for `lib.extend`.
|
||||||
extendLib = self: super: let
|
extendLib = import ./extend-lib.nix;
|
||||||
publicLib = import ./. { lib = super; };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit (publicLib) filesToAttr countAttrs getSecrets
|
|
||||||
attachSopsPathPrefix;
|
|
||||||
private = publicLib
|
|
||||||
// import ./private.nix { lib = self; };
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# A thin wrapper around the NixOS configuration function.
|
# A thin wrapper around the NixOS configuration function.
|
Loading…
Reference in New Issue
Block a user