From c3abd38ab0f4548f2c59a0e85d9c0276304ec802 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 17 Jan 2022 21:49:19 +0100 Subject: ... --- flake.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 26d6c0b..3121c76 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,13 @@ ref = "master"; flake = false; }; + sops = { + type = "github"; + owner = "mozilla"; + repo = "sops"; + ref = "v3.7.1"; + flake = false; + }; }; outputs = { self, openwrt, nixpkgs, flake-utils, ... }@inputs: flake-utils.lib.eachDefaultSystem (system: @@ -97,6 +104,8 @@ # zlib.static # glibc.static + go + pkgconfig ubnt-mkfwimage gnused @@ -150,12 +159,49 @@ $(eval $(call BuildPackage,sunwait)) ''} $out/utils/sunwait/Makefile ''; + sopsRepo = pkgs.runCommand "openwrt-sops" {} '' + mkdir -p $out/utils/sops + cp ${pkgs.writeText "Makefile" '' + include $(TOPDIR)/rules.mk + + PKG_NAME:=sops + PKG_VERSION:=${inputs.sops.rev} + PKG_RELEASE:=1 + + PKG_BUILD_DEPENDS:=golang/host + PKG_BUILD_PARALLEL:=1 + PKG_USE_MIPS16:=0 + + GO_PKG:=go.mozilla.org/sops/v3/cmd/sops + + include $(INCLUDE_DIR)/package.mk + include ${inputs.openwrt-packages}/lang/golang/golang-package.mk + + define Package/sops + SECTION:=util + CATEGORY:=Utilities + SUBMENU:=Encryption + TITLE:=sops + URL:=https://github.com/mozilla/sops + DEPENDS:=$(GO_ARCH_DEPENDS) + PKGARCH:=all + endef + + define Build/Prepare + cp --no-preserve=mode --remove-destination -t $(PKG_BUILD_DIR) -r ${inputs.sops}/. + endef + + $(eval $(call GoBinPackage,sops)) + $(eval $(call BuildPackage,sops)) + ''} $out/utils/sops/Makefile + ''; feedsConf = pkgs.writeText "feeds.conf" '' src-cpy packages ${inputs.openwrt-packages} src-cpy luci ${inputs.openwrt-luci} src-cpy routing ${inputs.openwrt-routing} src-cpy telephony ${inputs.openwrt-telephony} src-cpy sunwait ${sunwaitRepo} + src-cpy sops ${sopsRepo} ''; in '' rm feeds.conf.default -- cgit v1.2.3