Home

cfg @main - refs - log -
-
https://git.jolheiser.com/cfg.git
Convert between various configuration formats
tree log patch
feat: nix Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmZmXg8ACgkQuFOtpdp7 v3pu9A//c7v3E/a9qUGh5NE4bdYR2ACZj/KBf+wl3hY/n7Rpd2cw4OS15elbYf4Q nP7B87q/VXLysQdM1ifsggVadliKzYFCZi08vlZzvbYx+KNNUJndeE13jYufCyp+ 2VnqjXcrPSZJ08BEW75OGMfLBfTuqNkrib2gAJCg1l3XWO8YV7hwQvrupll0eZrd lyhscCrTMMQUibxDEYhda1vo9EYclJ0/AUIVKj/cNwDqUPrWiB61WSR36GYiN9Ke Kud8x06+Nl9CPTvphLLhGiEwiY/CqiQhabgK5mZpXZ2eawlapEB0Rt3P0xx3xY14 2marHZDmwaV0+ihbXwD7nNkecw8/FkQXA3xCzafwZmnRbnrdodoAmalxLgl8z7W1 shog0JoaFVtLUns3UTJ11fkr6xytkxL4nAe1l0vNipYrWssS+hAy0eG9EpFUJgmt LHUFvPYm3Bg/Ihy3d0mNzrxdWNWxy//LfmGPTaDQzfoKHDJor8NwFVepgKlI+PWj JnqdbfCwdH5AMc01hHElbbOsmI+nqgxIHH/aWOTiB3uqILOFTtxUxjHbODGAlW3z +ZBM3PpG5/CIPO29i0scX4i4q7myxO6akrX/TOPoXWf/54kXZaXI4/XF+9whIrO9 gA9PRmsD4mrrYwVN5ZmVhOqwJfhR8SO14vliOKDN0ajrU/idIC0= =OJoO -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
6 months ago
4 changed files, 81 additions(+), 0 deletions(-)
I .gitignore
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..38d8daa5ce92c353ff9b2da3e87f72d72a41762d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/cfg
+result/
I flake.lock
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000000000000000000000000000000000000..25504b027011490ec3e609ccb240a44082dfed75
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1717786204,
+        "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "051f920625ab5aabe37c920346e3e69d7d34400e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
I flake.nix
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000000000000000000000000000000000000..0c17f6aaa8948fa427dcae08bd7aa32a138d7f43
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,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";
+        };
+      };
+    });
+  };
+}
I go.mod.sri
diff --git a/go.mod.sri b/go.mod.sri
new file mode 100644
index 0000000000000000000000000000000000000000..44410ee0cd981225930fb804eaee6ace814d2fd1
--- /dev/null
+++ b/go.mod.sri
@@ -0,0 +1 @@
+sha256-IKdsBsOJ41qh/d2ZxgkY0IihIGieYlTtdHRmFufS+yQ=
\ No newline at end of file