flake overlay test

This commit is contained in:
zsuper 2025-04-03 09:46:52 -07:00
parent 8ab065fca1
commit 4982420160
2 changed files with 16 additions and 5 deletions

6
flake.lock generated
View file

@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1743448293,
"narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=",
"lastModified": 1743583204,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3",
"rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434",
"type": "github"
},
"original": {

View file

@ -12,12 +12,17 @@
# TODO: Maybe add configuration options for toggling Makefile {C/LD/OPT}FLAGS
systems = ["x86_64-linux"];
imports = [inputs.flake-parts.flakeModules.easyOverlay];
perSystem = {
config,
pkgs,
...
}: {
packages.default = config.packages.proxytunnel;
overlayAttrs = {
inherit (config.packages) proxytunnel;
enableSSL = true;
};
packages.proxytunnel = pkgs.stdenv.mkDerivation {
pname = "proxytunnel";
@ -33,10 +38,16 @@
installPhase = ''
mkdir -p $out/bin
cp ./proxytunnel $out/bin
cp ./proxytunnel $out/bin/${
if config.overlayAttrs.enableSSL
then "proxytunnel-yes-ssl"
else "proxytunnel-no-ssl"
}
'';
};
packages.default = config.packages.proxytunnel;
devShells.default = pkgs.mkShell {
packages = [config.packages.default];
};