From 3aa92e52bcd16b0d3691f10c8db0d25f758b60e2 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Sun, 30 Jun 2024 13:25:41 -0500 Subject: [PATCH] initial --- .envrc | 1 + .gitignore | 2 ++ flake.lock | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 38 +++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2efaad0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.direnv +result* diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..45e90ee --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1719770832, + "narHash": "sha256-60+ZpoWArajSLyKMhZwiCeCbhsg9z2FlAJc3/n9g3bs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "54d99d57971230030c95ea3022f8bc862148b5b2", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..67d0d72 --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { inherit system; }; + + org = "anyproto"; + + flakePkgs = rec { + any-sync-node = + with pkgs; + buildGoModule rec { + name = "any-sync-node"; + src = fetchFromGitHub { + owner = org; + repo = name; + rev = "v0.3.34"; + hash = "sha256-lp2gV9aBOckjjD5ENWXwRijVQjA8fhxa/nMd+skR9sA="; + }; + vendorHash = "sha256-0Cs5j1p5AZK1CgCsTt7gOUleAwJFnHPOvlXtretAoe4="; + hardeningDisable = ["all"]; + }; + }; + in + { + packages = flake-utils.lib.flattenTree flakePkgs; + devShell = pkgs.mkShell { packages = with pkgs; [ nixfmt-rfc-style ]; }; + } + ); +}