add more samples and update README

This commit is contained in:
Emil Lerch 2024-11-01 14:21:02 -07:00
parent f3560889a2
commit 70d4601c9b
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
4 changed files with 69 additions and 60 deletions

View File

@ -1 +1,23 @@
Various examples for different nix flakes, useful for `nix develop` Various examples for different nix flakes, useful for `nix develop`
Usage
-----
Several options for using these flakes:
1. Copy the flake.nix file locally, use nix develop
2. Use in place with nix develop. For example, for hugo:
```sh
$ nix develop https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/hugo
```
3. Use with [devenv](https://devenv.sh/). Again, hugo example. Add this to `.envrc`:
```sh
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
fi
use flake 'https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/hugo'
```

View File

@ -1,60 +0,0 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730272153,
"narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

23
node/flake.nix Normal file
View File

@ -0,0 +1,23 @@
{
description = "Good basic flake template";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
systempkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = systempkgs.mkShell {
buildInputs = with systempkgs; [
# specific nodejs versions available, e.g. nodejs_18
nodejs_20
nodePackages.typescript-language-server
];
};
}
);
}

24
wrangler/flake.nix Normal file
View File

@ -0,0 +1,24 @@
{
description = "Good basic flake template";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
systempkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = systempkgs.mkShell {
buildInputs = with systempkgs; [
# specific nodejs versions available, e.g. nodejs_18
nodejs_20
nodePackages.typescript-language-server
wrangler
];
};
}
);
}