trying something?

Zynh Ludwig 2024-08-19 06:58:12 -07:00
parent 6fdc07c9eb
commit ef4d27f82c
4 changed files with 9 additions and 8 deletions

View File

@ -9,11 +9,13 @@ let
});
lib = nixpkgs.lib;
libExt = import ./. lib;
inherit (inputs.home-manager.lib) homeManagerConfiguration;
inherit (lib) nixosSystem;
inherit (lib.strings) optionalString;
inherit (lib.attrsets) nameValuePair;
inherit (libExt) right;
in
rec {
toPartialNixosConfig =
@ -32,7 +34,7 @@ rec {
});
compileSystems =
systems:
lib.right
right
builtins.listToAttrs
(map toPartialNixosConfig)
systems;
@ -56,7 +58,7 @@ rec {
});
compileHomes =
systems:
lib.right
right
builtins.listToAttrs
(map toPartialHomeManagerConfig)
systems;

View File

@ -1,7 +1,4 @@
final: prev:
let
inherit (final) isFunction;
in
lib:
rec {
# Ternary operator
# Exaample:
@ -12,7 +9,7 @@ rec {
# Right-associate and chain following single-operand functions
# Example:
# right f g h 1 => f(g(h(1)))
right = f: g: tern (isFunction g)
right = f: g: tern (lib.isFunction g)
(right (x: f (g (x))))
(f (g));
}

2
lib/overlay.nix Normal file
View File

@ -0,0 +1,2 @@
final: prev:
(import ./. { lib = prev; })

View File

@ -3,7 +3,7 @@ let
callDefaultPackage = path: prev.callPackage path { };
in
{
lib = prev.lib.extend import ../lib;
lib = prev.lib.extend import ../lib/overlay.nix;
wrapWine = callDefaultPackage ./wrapWine;
writeXrandrScriptBin = callDefaultPackage ./writeXrandrScriptBin;