mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-01 04:57:44 +00:00
feat: add an overlay
This commit is contained in:
parent
bb7f2ad3f1
commit
7acde21fc5
1 changed files with 38 additions and 35 deletions
37
flake.nix
37
flake.nix
|
@ -15,12 +15,21 @@
|
||||||
|
|
||||||
nixpkgsForHost = host:
|
nixpkgsForHost = host:
|
||||||
import inputs.nixpkgs {
|
import inputs.nixpkgs {
|
||||||
overlays = [
|
overlays = [overlay];
|
||||||
(self: super: {
|
system = host;
|
||||||
alejandra = self.rustPlatform.buildRustPackage {
|
};
|
||||||
|
|
||||||
|
nixpkgs."aarch64-darwin" = nixpkgsForHost "aarch64-darwin";
|
||||||
|
nixpkgs."aarch64-linux" = nixpkgsForHost "aarch64-linux";
|
||||||
|
nixpkgs."i686-linux" = nixpkgsForHost "i686-linux";
|
||||||
|
nixpkgs."x86_64-darwin" = nixpkgsForHost "x86_64-darwin";
|
||||||
|
nixpkgs."x86_64-linux" = nixpkgsForHost "x86_64-linux";
|
||||||
|
|
||||||
|
overlay = final: prev: {
|
||||||
|
alejandra = final.rustPlatform.buildRustPackage {
|
||||||
pname = "alejandra";
|
pname = "alejandra";
|
||||||
inherit version;
|
inherit version;
|
||||||
src = self.stdenv.mkDerivation {
|
src = final.stdenv.mkDerivation {
|
||||||
name = "src";
|
name = "src";
|
||||||
builder = builtins.toFile "builder.sh" ''
|
builder = builtins.toFile "builder.sh" ''
|
||||||
source $stdenv/setup
|
source $stdenv/setup
|
||||||
|
@ -37,28 +46,19 @@
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
passthru.tests = {
|
passthru.tests = {
|
||||||
version = self.testVersion {package = super.alejandra;};
|
version = final.testVersion {package = prev.alejandra;};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "The Uncompromising Nix Code Formatter.";
|
description = "The Uncompromising Nix Code Formatter.";
|
||||||
homepage = "https://github.com/kamadorueda/alejandra";
|
homepage = "https://github.com/kamadorueda/alejandra";
|
||||||
license = self.lib.licenses.unlicense;
|
license = final.lib.licenses.unlicense;
|
||||||
maintainers = [self.lib.maintainers.kamadorueda];
|
maintainers = [final.lib.maintainers.kamadorueda];
|
||||||
platforms = self.lib.systems.doubles.all;
|
platforms = final.lib.systems.doubles.all;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
|
||||||
];
|
|
||||||
system = host;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs."aarch64-darwin" = nixpkgsForHost "aarch64-darwin";
|
|
||||||
nixpkgs."aarch64-linux" = nixpkgsForHost "aarch64-linux";
|
|
||||||
nixpkgs."i686-linux" = nixpkgsForHost "i686-linux";
|
|
||||||
nixpkgs."x86_64-darwin" = nixpkgsForHost "x86_64-darwin";
|
|
||||||
nixpkgs."x86_64-linux" = nixpkgsForHost "x86_64-linux";
|
|
||||||
|
|
||||||
buildBinariesForHost = host: pkgs: let
|
buildBinariesForHost = host: pkgs: let
|
||||||
binaries = builtins.listToAttrs (
|
binaries = builtins.listToAttrs (
|
||||||
builtins.map (pkg: {
|
builtins.map (pkg: {
|
||||||
|
@ -115,6 +115,9 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inherit overlay;
|
||||||
|
overlays.default = overlay;
|
||||||
|
|
||||||
packages."aarch64-darwin" = with nixpkgs."aarch64-darwin";
|
packages."aarch64-darwin" = with nixpkgs."aarch64-darwin";
|
||||||
buildBinariesForHost "aarch64-darwin" [
|
buildBinariesForHost "aarch64-darwin" [
|
||||||
alejandra
|
alejandra
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue