docs: add a simple example for using a single package in a devshell
This commit is contained in:
parent
c1a1e27c83
commit
8d807e746a
1 changed files with 29 additions and 0 deletions
29
README.md
29
README.md
|
|
@ -91,6 +91,35 @@ for its content.
|
|||
***NUR does not check the repository for malicious content on a regular basis
|
||||
and it is recommended to check the expressions before installing them.***
|
||||
|
||||
### Using a single package in a devshell
|
||||
|
||||
This simple example demostrates how to add a single package from nur to a devshell defined in a flake.nix.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nur.url = "github:nix-community/NUR";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, nur }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ nur.overlay ];
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ pkgs.nur.repos.mic92.hello-nur ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
### Using the flake in NixOS
|
||||
|
||||
Using overlays and modules from NUR in your configuration is fairly straight forward.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue