Skip to content

Instantly share code, notes, and snippets.

View yunfachi's full-sized avatar
🏴‍☠️
github.com/orgs/community/discussions/101476

yunfachi yunfachi

🏴‍☠️
github.com/orgs/community/discussions/101476
View GitHub Profile
@yunfachi
yunfachi / default.nix
Last active December 10, 2023 17:10
Nix / NixOS : Import all files from current directory
{...}: {
# imports by full path without copying to /nix/store
imports = builtins.map (n: toString ./. + "/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
# copies all files from the current directory to /nix/store and imports from /nix/store
# imports = builtins.map (n: "${./.}/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
}
the...
the...
the...
the...
the...
the...