From a524bf5c41c17975d7e85d87db1dc1d49e472f88 Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Tue, 30 Jul 2024 16:12:20 +0200 Subject: Initial commit --- flake.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') 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."; + }; + }; + }; +} -- cgit v1.3.1