cfg/flake.nix

52 lines
1.1 KiB
Nix

{
description = "cfg";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
...
}: let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
inherit (nixpkgs) lib;
forEachSystem = f: (lib.listToAttrs (
map (system: {
name = system;
value = f {
inherit system;
pkgs = import nixpkgs {
inherit system;
};
};
})
systems
));
in {
packages = forEachSystem ({
pkgs,
system,
}: {
default = self.packages.${system}.cfg;
cfg = pkgs.buildGoModule rec {
pname = "cfg";
version = self.rev or "dev";
src = pkgs.nix-gitignore.gitignoreSource [] (builtins.path {
name = pname;
path = ./.;
});
subPackages = ["cmd/cfg"];
vendorHash = nixpkgs.lib.fileContents ./go.mod.sri;
meta = {
description = "config transpiler";
homepage = "https://git.jolheiser.com/cfg";
mainProgram = "cfg";
};
};
});
};
}