aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix42
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.";
+ };
+ };
+ };
+}