From c7e1577e08439081fbb3a6bfa2b49a0b29e94cdd Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 19 Feb 2024 05:50:03 +0100 Subject: add fysiweb-cli to shell --- nix/sources.json | 15 +++++++++++---- shell.nix | 19 +++++++++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/nix/sources.json b/nix/sources.json index 5530bfa..9195cbd 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,14 +1,21 @@ { + "fysiweb-cli": { + "branch": "main", + "repo": "git@github.com:aforemny/fysiweb-cli.git", + "rev": "4fb5cf073e601b93042670e94210b8af1ce85ebe", + "submodules": true, + "type": "git" + }, "nixpkgs": { - "branch": "nixos-unstable", + "branch": "nixos-23.11", "description": "Nix Packages collection", "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "6c43a3495a11e261e5f41e5d7eda2d71dae1b2fe", - "sha256": "16f329z831bq7l3wn1dfvbkh95l2gcggdwn6rk3cisdmv2aa3189", + "rev": "84d981bae8b5e783b3b548de505b22880559515f", + "sha256": "0d6j5d31kzfla0x8f64ranp681dhd0hwxihbf3jjpb18cnddxag8", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/6c43a3495a11e261e5f41e5d7eda2d71dae1b2fe.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/84d981bae8b5e783b3b548de505b22880559515f.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nomath-org": { diff --git a/shell.nix b/shell.nix index 1b660a3..5608b0b 100644 --- a/shell.nix +++ b/shell.nix @@ -1,12 +1,27 @@ -{ pkgs ? import { } }: +{ sources ? import ./nix/sources.nix +, pkgs ? import sources.nixpkgs { + overlays = [ + (self: super: { + fysiweb-cli = import sources.fysiweb-cli { }; + }) + (self: super: { + fysiweb.cli = pkgs.writers.writeDashBin "fysiweb" '' + set -efu + HETZNER_DNS_API_TOKEN=$(${self.pass}/bin/pass show hetznerdns-api-token); export HETZNER_DNS_API_TOKEN + exec ${super.fysiweb.cli}/bin/fysiweb "$@" + ''; + }) + ]; + } +}: let inherit (pkgs) lib; in pkgs.mkShell { buildInputs = [ + pkgs.fysiweb-cli pkgs.git pkgs.niv ]; shellHook = '' PASSWORD_STORE_DIR=${lib.escapeShellArg (toString ./.)}/secrets; export PASSWORD_STORE_DIR - HETZNER_DNS_API_TOKEN=$(pass show hetznerdns-api-token); export HETZNER_DNS_API_TOKEN ''; } -- cgit v1.2.3