mirror of
https://github.com/mitchellh/zig-overlay.git
synced 2025-05-08 18:46:02 +03:00
Merge fb77f77e83
into 3cf5310e0b
This commit is contained in:
commit
58b8628125
2 changed files with 62 additions and 70 deletions
23
flake.lock
generated
23
flake.lock
generated
|
@ -16,24 +16,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1705309234,
|
|
||||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1708161998,
|
"lastModified": 1708161998,
|
||||||
|
@ -53,11 +35,12 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs": "nixpkgs"
|
"systems": "systems"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681028828,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
|
109
flake.nix
109
flake.nix
|
@ -3,7 +3,10 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
systems = {
|
||||||
|
url = "github:nix-systems/default";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Used for shell.nix
|
# Used for shell.nix
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
|
@ -15,59 +18,65 @@
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
systems,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
|
inherit (nixpkgs) lib;
|
||||||
outputs = flake-utils.lib.eachSystem systems (system: let
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in rec {
|
|
||||||
# The packages exported by the Flake:
|
|
||||||
# - default - latest /released/ version
|
|
||||||
# - <version> - tagged version
|
|
||||||
# - master - latest nightly (updated daily)
|
|
||||||
# - master-<date> - nightly by date
|
|
||||||
packages = import ./default.nix {inherit system pkgs;};
|
|
||||||
|
|
||||||
# "Apps" so that `nix run` works. If you run `nix run .` then
|
eachSystem = lib.genAttrs (import systems);
|
||||||
# this will use the latest default.
|
|
||||||
apps = rec {
|
|
||||||
default = apps.zig;
|
|
||||||
zig = flake-utils.lib.mkApp {drv = packages.default;};
|
|
||||||
};
|
|
||||||
|
|
||||||
# nix fmt
|
pkgsFor = eachSystem (system: nixpkgs.legacyPackages.${system});
|
||||||
formatter = pkgs.alejandra;
|
in {
|
||||||
|
# The packages exported by the Flake:
|
||||||
|
# - default - latest /released/ version
|
||||||
|
# - <version> - tagged version
|
||||||
|
# - master - latest nightly (updated daily)
|
||||||
|
# - master-<date> - nightly by date
|
||||||
|
packages = lib.mapAttrs (system: pkgs: import ./default.nix {inherit system pkgs;}) pkgsFor;
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
# Overlay that can be imported so you can access the packages
|
||||||
nativeBuildInputs = with pkgs; [
|
# using zigpkgs.master or whatever you'd like.
|
||||||
curl
|
overlays.default = final: prev: {
|
||||||
jq
|
zigpkgs = self.packages.${prev.system};
|
||||||
minisign
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# For compatibility with older versions of the `nix` binary
|
|
||||||
devShell = self.devShells.${system}.default;
|
|
||||||
});
|
|
||||||
in
|
|
||||||
outputs
|
|
||||||
// {
|
|
||||||
# Overlay that can be imported so you can access the packages
|
|
||||||
# using zigpkgs.master or whatever you'd like.
|
|
||||||
overlays.default = final: prev: {
|
|
||||||
zigpkgs = outputs.packages.${prev.system};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Templates for use with nix flake init
|
|
||||||
templates.compiler-dev = {
|
|
||||||
path = ./templates/compiler-dev;
|
|
||||||
description = "A development environment for Zig compiler development.";
|
|
||||||
};
|
|
||||||
|
|
||||||
templates.init = {
|
|
||||||
path = ./templates/init;
|
|
||||||
description = "A basic, empty development environment.";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# "Apps" so that `nix run` works. If you run `nix run .` then
|
||||||
|
# this will use the latest default.
|
||||||
|
apps = eachSystem (system: {
|
||||||
|
default = self.apps.${system}.zig;
|
||||||
|
zig = {
|
||||||
|
type = "app";
|
||||||
|
program = self.packages.${system}.default.outPath;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
# nix fmt
|
||||||
|
formatter = lib.mapAttrs (_: pkgs: pkgs.alejandra) pkgsFor;
|
||||||
|
|
||||||
|
devShells =
|
||||||
|
lib.mapAttrs (system: pkgs: {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
curl
|
||||||
|
jq
|
||||||
|
minisign
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
pkgsFor;
|
||||||
|
|
||||||
|
# For compatibility with older versions of the `nix` binary
|
||||||
|
devShell = eachSystem (system: self.devShells.${system}.default);
|
||||||
|
|
||||||
|
# Templates for use with nix flake init
|
||||||
|
templates.compiler-dev = {
|
||||||
|
path = ./templates/compiler-dev;
|
||||||
|
description = "A development environment for Zig compiler development.";
|
||||||
|
};
|
||||||
|
|
||||||
|
templates.init = {
|
||||||
|
path = ./templates/init;
|
||||||
|
description = "A basic, empty development environment.";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue