mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
docs: document nixos installation
This commit is contained in:
parent
2842bdc239
commit
a15388c7ad
1 changed files with 50 additions and 0 deletions
50
README.md
50
README.md
|
@ -155,6 +155,56 @@ Then run Alejandra with:
|
|||
$ alejandra --help
|
||||
```
|
||||
|
||||
### NixOS installation
|
||||
|
||||
- Nix with [Flakes](https://nixos.wiki/wiki/Flakes):
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
alejandra.url = "github:kamadorueda/alejandra/0.7.0";
|
||||
alejandra.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {alejandra, nixpkgs, ...}: {
|
||||
nixosConfigurations = {
|
||||
example = nixpkgs.lib.nixosSystem rec {
|
||||
# We support: aarch64-linux, aarch64-linux, x86_64-darwin, x86_64-linux
|
||||
system = "x86_64-linux";
|
||||
|
||||
modules = [
|
||||
{
|
||||
environment.systemPackages = [alejandra.defaultPackage.${system}];
|
||||
}
|
||||
# Import your other modules here
|
||||
# ./path/to/my/module.nix
|
||||
# ...
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
- Nix stable:
|
||||
|
||||
```nix
|
||||
let
|
||||
alejandra =
|
||||
(import (builtins.fetchTarball {
|
||||
url = "https://github.com/kamadorueda/alejandra/tarball/0.7.0";
|
||||
sha256 = "0kqkwi4j1d0n334jl3q6x70ga8jqmqpv514zsbfca2a86c7qs6cf";
|
||||
}))
|
||||
# Pick one from: aarch64-linux, aarch64-linux, x86_64-darwin, x86_64-linux
|
||||
.x86_64-linux
|
||||
.outPath;
|
||||
in {
|
||||
environment.systemPackages = [alejandra];
|
||||
}
|
||||
```
|
||||
|
||||
## Do I need to configure anything?
|
||||
|
||||
- No.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue