More git conversion stuff

This commit is contained in:
Luke Granger-Brown 2024-11-11 00:33:10 +00:00
parent 8a1c371b63
commit 8919df8542
6 changed files with 44 additions and 56 deletions

39
.gitignore vendored Normal file
View file

@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2024 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
/ops/secrets/
# For now, ignore the freeswitch config until I have it in a good state.
/ops/nixos/lib/freeswitch/
/ops/vault/cfg/tf/
/ops/vault/cfg/secrets.nix
/rust/passgen/input/
/rust/passgen/target/
/web/quotes/theme/static/
/nix/pkgs/factorio-mods/cache/
/nix/pkgs/factorio-mods/.pytest_cache/
/py/tumblrcap/dl/
/py/tumblrcap/mylikes.*
/go/trains/*/start.sh
/go/trains/*/lukegb-trains.json
/py/icalfilter/config/*
/rust/*/target/*
result-*
*.sw?
*.pyc
*.orig
*~
db.sqlite3
node_modules/
.next/
out/
firebase-debug.log
.ruff_cache/

View file

@ -88,8 +88,6 @@
srsran5g = pkgs.callPackage ./srsran5g { }; srsran5g = pkgs.callPackage ./srsran5g { };
open5gs = pkgs.callPackage ./open5gs { }; open5gs = pkgs.callPackage ./open5gs { };
zigbee2mqtt = pkgs.callPackage ./zigbee2mqtt.nix { };
seaweedfs = pkgs.callPackage ./seaweedfs { }; seaweedfs = pkgs.callPackage ./seaweedfs { };
bsky-pds = pkgs.callPackage ./bsky-pds { }; bsky-pds = pkgs.callPackage ./bsky-pds { };
} // (import ./heptapod-runner args) } // (import ./heptapod-runner args)

View file

@ -1,22 +0,0 @@
{ zigbee2mqtt, fetchNpmDeps, fetchFromGitHub, lib, ... }:
assert zigbee2mqtt.version == "1.40.2";
zigbee2mqtt.overrideAttrs (old: rec {
version = "0-unstable-2024-10-13";
src = fetchFromGitHub {
owner = "lukegb";
repo = "zigbee2mqtt";
rev = "d2c92da66574aff205f758cd2c12dfdd9a614290";
hash = "sha256-5TY0nOWIX196zs5hw2Wk1un+QrTASPwpXMF7nD0EjS0=";
};
npmDepsHash = "sha256-2MTr5dF2PGUuHvJMCVzjGI8mcdkhxshf5v6GAwYUJf0=";
makeCacheWritable = true;
npmDeps = fetchNpmDeps {
inherit src;
name = "zigbee2mqtt-npm-deps";
hash = npmDepsHash;
};
})

View file

@ -69,6 +69,7 @@ let
unifi-poller = false; unifi-poller = false;
snmp = false; snmp = false;
minio = false; minio = false;
tor = false;
}; };
stockExporters = lib.mapAttrsToList (exporterName: exporter: mkExporter exporterName exporter.port) (lib.filterAttrs (exporterName: exporter: (allowStockExporters.${exporterName} or true) && builtins.isAttrs exporter && exporter.enable) sys.config.services.prometheus.exporters); stockExporters = lib.mapAttrsToList (exporterName: exporter: mkExporter exporterName exporter.port) (lib.filterAttrs (exporterName: exporter: (allowStockExporters.${exporterName} or true) && builtins.isAttrs exporter && exporter.enable) sys.config.services.prometheus.exporters);
customExporters = lib.mapAttrsToList mkExporter sys.config.my.prometheus.additionalExporterPorts; customExporters = lib.mapAttrsToList mkExporter sys.config.my.prometheus.additionalExporterPorts;

View file

@ -5,7 +5,7 @@ let
in { in {
services.zigbee2mqtt = { services.zigbee2mqtt = {
enable = true; enable = true;
package = depot.nix.pkgs.zigbee2mqtt; package = pkgs.zigbee2mqtt;
settings = { settings = {
homeassistant = true; homeassistant = true;
serial.port = "/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_eca6e9ba6596ed11ac206b4ce259fb3e-if00-port0"; serial.port = "/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_eca6e9ba6596ed11ac206b4ce259fb3e-if00-port0";

View file

@ -1,35 +1,7 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com> # SPDX-FileCopyrightText: 2024 Luke Granger-Brown <depot@lukegb.com>
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
{ pkgs, ... }: { lib, ... }:
let "depot-" + lib.trim (builtins.readFile .git/HEAD)
inherit (pkgs) lib;
inherit (builtins) elemAt match length;
hgRelativePath = path: elemAt (match ".*/\\.hg/(.*)$" path) 0;
hgDepth = path: length (lib.splitString "/" (hgRelativePath path));
hgRepo = builtins.path {
path = ./.hg;
name = "depot-hg";
filter = path: type: (type == "directory" && (
hgRelativePath path == "store" ||
hgRelativePath path == "merge" ||
hgRelativePath path == "cache")) ||
(type == "regular" && hgDepth path == 1) ||
(type == "regular" && hgDepth path == 2);
};
changesetDeriv = pkgs.runCommandLocal "depot-version" {
HG_REPO = hgRepo;
MERCURIAL = pkgs.mercurial;
} ''
export HGPLAIN=
mytmp=$(mktemp -d)
pushd $mytmp
ln -s $HG_REPO .hg
echo -n "depot-$($MERCURIAL/bin/hg id --id -r.)" > $out
popd
rm -rf $mytmp
'';
in
builtins.readFile changesetDeriv