mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-18 17:14:32 +01:00
Nix support & automated update (#130)
* Add a nix flake * Update flake deps and nix package's version nightly * nix-flake: Update vendorSha256 on each push An extra commit will be pushed only if needed * Move flake.* into root directory Update flake.lock * nix-flake: Support more systems, commit hash as version * Don't automatically update flake.lock
This commit is contained in:
committed by
GitHub
parent
d5290ebd32
commit
b8d9727833
44
flake.nix
Normal file
44
flake.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}:
|
||||
with nixpkgs.lib; let
|
||||
# List of explicetely unsupported systems
|
||||
explicitelyUnsupportedSystems = [];
|
||||
|
||||
# Packwiz should support all 64-bit systems supported by go, but nix only
|
||||
# support strictly less, so all nix-supported systems are included
|
||||
# (except ones in explicitelyUnsupportedSystems).
|
||||
supportedSystems =
|
||||
filter
|
||||
# Filter out systems that are explicetely supported
|
||||
(s: ! elem s explicitelyUnsupportedSystems)
|
||||
# This lists all systems reasonably well-supported by nix
|
||||
(import "${nixpkgs}/lib/systems/flake-systems.nix" {});
|
||||
|
||||
# Helper generating outputs for each supported system
|
||||
forAllSystems = genAttrs supportedSystems;
|
||||
|
||||
# Import nixpkgs' package set for each system.
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
||||
in {
|
||||
# Packwiz package
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in rec {
|
||||
packwiz = pkgs.callPackage ./nix {
|
||||
version = substring 0 8 self.rev or "dirty";
|
||||
vendorSha256 = readFile ./nix/vendor-sha256;
|
||||
buildGoModule = pkgs.buildGo118Module;
|
||||
};
|
||||
# Build packwiz by default when no package name is specified
|
||||
default = packwiz;
|
||||
});
|
||||
|
||||
# This flake's nix code formatter
|
||||
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user