From bbf2e16555eee9a66fc7a7c401f941418defb6ba Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 23 Feb 2022 10:15:29 +0100 Subject: [PATCH 1/2] Update `README` - Add flake example file --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 6ecc7de..524a48a 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,30 @@ inputs.flake-compat = { }; ``` +Example in a `flake.nix` file: + +```nix +{ + description = "My first flake"; + + inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.flake-compat = { + url = github:edolstra/flake-compat; + flake = false; + }; + + outputs = { self, nixpkgs, flake-utils, flake-compat }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShell = pkgs.mkShell { buildInputs = [ pkgs.hello pkgs.cowsay ]; }; + } + ); +} +``` + Afterwards, create a `default.nix` file containing the following: ```nix -- 2.44.1 From 157c61590b2b4049ce5dbb247a511956a3b51fa9 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 19 Apr 2022 14:00:12 +0200 Subject: [PATCH 2/2] Update README.md Co-authored-by: Sandro --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 524a48a..ef8865d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Example in a `flake.nix` file: inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.flake-compat = { - url = github:edolstra/flake-compat; + url = "github:edolstra/flake-compat"; flake = false; }; -- 2.44.1