diff --git a/snippets/nix.snippets b/snippets/nix.snippets index 2dc567c..5a37be1 100644 --- a/snippets/nix.snippets +++ b/snippets/nix.snippets @@ -13,3 +13,36 @@ snippet optionalAttrs snippet deps let pkgs = import {}; in with pkgs; [ $1 ] + +snippet flake + { + description = "Flake utils $1"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.\${system}; + in + { + packages = rec { + $1 = pkgs.stdenv.mkDerivation { + name = "$1"; + buildInputs = with pkgs; [ + $2 + ]; + }; + default = $1; + }; + } + ); + }