add more samples and update README
This commit is contained in:
parent
f3560889a2
commit
70d4601c9b
22
README.md
22
README.md
|
@ -1 +1,23 @@
|
|||
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'
|
||||
```
|
||||
|
|
|
@ -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
23
node/flake.nix
Normal 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
24
wrangler/flake.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user