]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - flakes/lib/flake.nix
Add flake skeletons
[perso/Immae/Config/Nix.git] / flakes / lib / flake.nix
1 {
2 inputs.nixpkgs.url = "github:NixOS/nixpkgs";
3
4 description = "Useful libs";
5 outputs = { self, nixpkgs }: {
6 lib = rec {
7 withNarKey = dep: moduleAttrs:
8 let module = dep.${moduleAttrs};
9 key = builtins.hashString "sha256" (builtins.path { path = dep.sourceInfo.outPath; name = "source"; });
10 in if builtins.isFunction module
11 then args@{ config, lib, pkgs, ... }: (module args // { inherit key; })
12 else module // { inherit key; };
13 };
14 };
15 }