diff options
| author | Miran Bastaja <miran.bastaja04@gmail.com> | 2024-07-30 16:12:20 +0200 |
|---|---|---|
| committer | Miran Bastaja <miran.bastaja04@gmail.com> | 2024-07-30 16:12:20 +0200 |
| commit | a524bf5c41c17975d7e85d87db1dc1d49e472f88 (patch) | |
| tree | 9ab3e2d69249671c85f670c32aa68b495f94c168 /flake.nix | |
Initial commit
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4016d27 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "Mashup of various utility functions that I use often."; + + inputs = { + systems.url = "github:nix-systems/default"; + }; + + outputs = + { + self, + nixpkgs, + systems, + }: + let + stdenvMinimal = nixpkgs.stdenvNoCC.override { + cc = null; + preHook = ""; + allowedRequsites = null; + initialPath = nixpkgs.lib.filter ( + a: nixpkgs.lib.hasPrefix "coreutils" a.name + ) nixpkgs.stdenvNoCC.initialPath; + extraNativeBuildInputs = [ ]; + }; + in + { + lib = { + # Basically equivalent to flake-utils' eachDefaultSystem + eachSystem = nixpkgs.lib.genAttrs (import systems); + + # Like mkShell, but with less dependencies. + # See https://fzakaria.com/2021/08/02/a-minimal-nix-shell.html + minimalMkShell = pkgs: pkgs.mkShell.override { stdenv = stdenvMinimal; }; + }; + + templates = { + eachSystem = { + path = ./examples/simple; + description = "Example showing off a few simple functions."; + }; + }; + }; +} |
