mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-29 03:27:44 +00:00
feat: simplify nix stable installation
This commit is contained in:
parent
1fad955df3
commit
bd7ca846d5
2 changed files with 36 additions and 30 deletions
50
README.md
50
README.md
|
@ -136,24 +136,18 @@ Please visit: [search.nixos.org/packages?query=alejandra](https://search.nixos.o
|
|||
|
||||
### Nix installation
|
||||
|
||||
- Nix stable:
|
||||
|
||||
```bash
|
||||
$ nix-env -ivf https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
```
|
||||
|
||||
- Nix with [Flakes](https://nixos.wiki/wiki/Flakes):
|
||||
|
||||
```bash
|
||||
$ nix profile install github:kamadorueda/alejandra/1.5.0
|
||||
```
|
||||
|
||||
- Nix stable:
|
||||
|
||||
Pick one depending on your platform:
|
||||
|
||||
```bash
|
||||
$ nix-env -ivA aarch64-darwin -f https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
$ nix-env -ivA aarch64-linux -f https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
$ nix-env -ivA i686-linux -f https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
$ nix-env -ivA x86_64-darwin -f https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
$ nix-env -ivA x86_64-linux -f https://github.com/kamadorueda/alejandra/tarball/1.5.0
|
||||
```
|
||||
|
||||
Then run Alejandra with:
|
||||
|
||||
```bash
|
||||
|
@ -162,6 +156,21 @@ $ alejandra --help
|
|||
|
||||
### NixOS installation
|
||||
|
||||
- Nix stable:
|
||||
|
||||
```nix
|
||||
let
|
||||
alejandra =
|
||||
(import (builtins.fetchTarball {
|
||||
url = "https://github.com/kamadorueda/alejandra/tarball/1.5.0";
|
||||
sha256 = "0000000000000000000000000000000000000000000000000000";
|
||||
}) {})
|
||||
.outPath;
|
||||
in {
|
||||
environment.systemPackages = [alejandra];
|
||||
}
|
||||
```
|
||||
|
||||
- Nix with [Flakes](https://nixos.wiki/wiki/Flakes):
|
||||
|
||||
```nix
|
||||
|
@ -193,23 +202,6 @@ $ alejandra --help
|
|||
}
|
||||
```
|
||||
|
||||
- Nix stable:
|
||||
|
||||
```nix
|
||||
let
|
||||
alejandra =
|
||||
(import (builtins.fetchTarball {
|
||||
url = "https://github.com/kamadorueda/alejandra/tarball/1.5.0";
|
||||
sha256 = "0000000000000000000000000000000000000000000000000000";
|
||||
}))
|
||||
# Pick one from: aarch64-darwin, aarch64-linux, i686-linux, x86_64-darwin, x86_64-linux
|
||||
.x86_64-linux
|
||||
.outPath;
|
||||
in {
|
||||
environment.systemPackages = [alejandra];
|
||||
}
|
||||
```
|
||||
|
||||
## Do I need to configure anything?
|
||||
|
||||
- No.
|
||||
|
|
16
default.nix
16
default.nix
|
@ -8,4 +8,18 @@ let
|
|||
};
|
||||
flake = import flakeCompatSrc {src = ./.;};
|
||||
in
|
||||
flake.defaultNix.defaultPackage
|
||||
{system ? builtins.currentSystem, ...}:
|
||||
if builtins.hasAttr system flake.defaultNix.defaultPackage
|
||||
then flake.defaultNix.defaultPackage.${system}
|
||||
else
|
||||
builtins.throw ''
|
||||
|
||||
Alejandra does not support the system: ${system}
|
||||
|
||||
Please consider creating an issue requesting
|
||||
support for such system:
|
||||
https://github.com/kamadorueda/alejandra
|
||||
|
||||
Thank you!
|
||||
|
||||
''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue