Home

cfg @main - refs - log -
-
https://git.jolheiser.com/cfg.git
Convert between various configuration formats
cfg / flake.nix
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  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";
        };
      };
    });
  };
}