1
Fork 0
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:
Kevin Amado 2022-03-03 13:53:14 -05:00
parent 2842bdc239
commit a15388c7ad

View file

@ -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.