1

add initial modules lib

This commit is contained in:
2022-08-08 20:28:54 +02:00
parent 872c566000
commit 403cafdef1

19
lib/modules.nix Normal file
View File

@ -0,0 +1,19 @@
{ inputs, pkgs, lib, ... }:
let
in {
mkBoolOpt = { def, desc ? "" }:
{
type = lib.types.bool;
default = def;
description = desc;
};
linkMutable = { src, dest, after }:
lib.hm.dag.entryAfter [ "writeBoundary" ] ++ after ''
if [ ! -L "${dest}" ]; then
ln -sf ${src} ${dest}
fi
'';
}