added nix tooling

This commit is contained in:
Eugenia Agibalova 2025-04-10 23:52:50 +04:00
parent 185a3a2c76
commit 826fcca1c9
5 changed files with 140 additions and 0 deletions

7
.gitignore vendored
View file

@ -140,3 +140,10 @@ __pycache__
snap/.snapcraft
tcp-proxy/tcp-proxy
rustybits/target
#direnv
.envrc
#nix stuff
result
result-man

64
flake.lock generated Normal file
View file

@ -0,0 +1,64 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1744157173,
"narHash": "sha256-bWSjxDwq7iVePrhmA7tY2dyMWHuNJo8knkO4y+q4ZkY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6a39c6e495eefabc935d8ddf66aa45d85b85fa3f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-zerotier-base": [
"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
}

35
flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
description = "Custom ZeroTierOne build with private patches";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# Pin to specific nixpkgs version for zerotierone base package
nixpkgs-zerotier-base = {
url = "github:NixOS/nixpkgs/d9d87c51960050e89c79e4025082ed965e770d68";
follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, nixpkgs-zerotier-base, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = {
zerotierone-tspu = pkgs.callPackage ./package.nix {
zerotierone = (import nixpkgs-zerotier-base { inherit system; }).zerotierone;
};
default = self.packages.${system}.zerotierone-tspu;
};
devShells.default = import ./shell.nix {
inherit pkgs;
};
}
);
}

18
package.nix Normal file
View file

@ -0,0 +1,18 @@
{ zerotierone, lib }:
zerotierone.overrideAttrs (oldAttrs: {
pname = "zerotierone-tspu";
version = "1.14.2-tspu";
src = builtins.fetchGit {
url = "git@git.dltech.ge:global-it/infra/zerotiertspu.git";
ref = "1.14.2";
};
patches = [];
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ ];
meta = oldAttrs.meta // {
description = "Custom ZeroTierOne build with private patches";
};
})

16
shell.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> { } }:
let
zerotieroneCustom = pkgs.callPackage ./package.nix {};
in
pkgs.mkShell {
packages = [ ]
++ zerotieroneCustom.buildInputs
++ zerotieroneCustom.nativeBuildInputs;
SSH_AUTH_SOCK = builtins.getEnv "SSH_AUTH_SOCK";
NIXPKGS_ALLOW_UNFREE = "1";
shellHook = ''
'';
}