mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 18:59:07 +01:00
25 lines
585 B
Nix
25 lines
585 B
Nix
{ self, ... }:
|
|
{
|
|
perSystem =
|
|
{
|
|
self',
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
mkScript = file: rec {
|
|
name =
|
|
file
|
|
|> lib.unsafeDiscardStringContext
|
|
|> lib.removePrefix "${self}/scripts/"
|
|
|> lib.removeSuffix ".nix"
|
|
|> lib.replaceString "/" "-";
|
|
value = pkgs.writeShellApplication ({ inherit name; } // import file { inherit self' pkgs lib; });
|
|
};
|
|
in
|
|
{
|
|
packages =
|
|
"${self}/scripts" |> lib.filesystem.listFilesRecursive |> lib.map mkScript |> lib.listToAttrs;
|
|
};
|
|
}
|