From a6fa1fc880906857ff053a9a9277ea202a2c9418 Mon Sep 17 00:00:00 2001 From: Naxdy Date: Thu, 2 Jan 2025 17:12:07 +0100 Subject: [PATCH] init --- .gitignore | 3 +++ flake.lock | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 42 +++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4eedd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.direnv +/result +/result-* diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..51e2f08 --- /dev/null +++ b/flake.lock @@ -0,0 +1,79 @@ +{ + "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": 1735471104, + "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "tunnelblick": "tunnelblick" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tunnelblick": { + "flake": false, + "locked": { + "lastModified": 1710264982, + "narHash": "sha256-yiVrHup5zz5XW7sB49llWnrTaPnJMf2/R5O3IDSLNP8=", + "owner": "Tunnelblick", + "repo": "Tunnelblick", + "rev": "2a85efdab228d7d29828ab63061eb59f799f84fa", + "type": "github" + }, + "original": { + "owner": "Tunnelblick", + "ref": "v4.0.1", + "repo": "Tunnelblick", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..78bbdd7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "OpenVPN with tunnelblick patches applied."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + flake-utils.url = "github:numtide/flake-utils"; + + tunnelblick = { + url = "github:/Tunnelblick/Tunnelblick?ref=v4.0.1"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, flake-utils, tunnelblick }: flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.${system}.default ]; + }; + in + { + packages.default = self.packages.${system}.openvpn-tunnelblick; + + packages.openvpn-tunnelblick = pkgs.openvpn-tunnelblick; + + overlays.default = self.overlays.${system}.openvpn-tunnelblick; + + overlays.openvpn-tunnelblick = + (self: super: { + openvpn-tunnelblick = super.openvpn.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + "${tunnelblick}/third_party/sources/openvpn/openvpn-2.6.9/patches/02-tunnelblick-openvpn_xorpatch-a.diff" + "${tunnelblick}/third_party/sources/openvpn/openvpn-2.6.9/patches/03-tunnelblick-openvpn_xorpatch-b.diff" + "${tunnelblick}/third_party/sources/openvpn/openvpn-2.6.9/patches/04-tunnelblick-openvpn_xorpatch-c.diff" + "${tunnelblick}/third_party/sources/openvpn/openvpn-2.6.9/patches/05-tunnelblick-openvpn_xorpatch-d.diff" + "${tunnelblick}/third_party/sources/openvpn/openvpn-2.6.9/patches/06-tunnelblick-openvpn_xorpatch-e.diff" + ]; + }); + }); + }); +}