Merge branch 'master' of git.uninsane.org:shelvacu/nix-stuff

This commit is contained in:
Shelvacu
2025-08-04 14:38:45 -07:00
committed by Shelvacu on nix-on-droid
4 changed files with 87 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
mailLocation = "mdbox:~/mail";
extraConfig = ''
mail_home = /var/lib/mail/%n
mail_max_userip_connections = 100
service auth {
unix_listener /var/lib/postfix/queue/private/dovecot-auth {
group = ${config.services.postfix.group}

View File

@@ -0,0 +1,18 @@
diff --git i/eyefi-linux.c w/eyefi-linux.c
index 091157d..1622244 100644
--- i/eyefi-linux.c
+++ w/eyefi-linux.c
@@ -128,11 +128,12 @@ int zero_file(enum eyefi_file file, char *mnt)
char *zerobuf[EYEFI_BUF_SIZE];
int fd;
int ret;
+ mode_t perms = 0777;
memset(&zerobuf[0], 0, EYEFI_BUF_SIZE);
fname = eyefi_file_on(file, mnt);
debug_printf(1, "creating control file: '%s'\n", fname);
- fd = open(fname, O_WRONLY|O_CREAT);
+ fd = open(fname, O_WRONLY|O_CREAT, perms);
ret = fd;
if (ret < 0)
goto out;

View File

@@ -0,0 +1,31 @@
{
lib,
fetchFromGitHub,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "eyefi-config";
version = "0-unstable-2025-04-08";
src = fetchFromGitHub {
owner = "hansendc";
repo = "eyefi-config";
rev = "3f0d0a5433442eadaefd067da42e501089463395";
hash = "sha256-vLl+WyU1v6y84w/rvqWh1xBoBMNGPc0+LvGAbIqPin0=";
};
patches = [ ./fix-open-call.patch ];
installPhase = ''
mkdir -p $out/bin
cp eyefi-config $out/bin/eyefi-config
'';
meta = {
description = "CLI tool for configuring Eye-Fi brand SD cards";
homepage = "https://github.com/hansendc/eyefi-config";
license = lib.licenses.gpl2Only;
sourceProvenance = [ lib.sourceTypes.fromSource ];
mainProgram = "eyefi-config";
};
})

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
source shellvaculib.bash
name="$HOSTNAME"
config='
organization = "Shelvacu"
state = "Washington"
country = US
cn = "'"$name"'"
expiration_days = -1
signing_key
encryption_key
tls_www_client
'
dest_prefix="$HOME/.pki/vacu-client-cert"
dest_key="$dest_prefix.key"
dest_cert="$dest_prefix.cert"
dest_p12="$dest_prefix.p12"
# dest_combined="$dest_prefix.combined"
if [[ -f $dest_key ]]; then
svl_die "$dest_key already exists"
fi
if [[ -f $dest_cert ]]; then
svl_die "$dest_cert already exists"
fi
certtool --generate-privkey --outfile="$dest_key" --key-type=ed25519 --sec-param=high
certtool --generate-self-signed --load-privkey "$dest_key" --template <(echo "$config") --outfile "$dest_cert"
certtool --load-certificate "$dest_cert" --load-privkey "$dest_key" --to-p12 --p12-name vacu-client-cert-"$name" --password=password --outfile "$dest_p12"
# cat "$dest_key" "$dest_cert" > "$dest_combined"
certutil -d "sql:$HOME/.pki/nssdb" -A -n vacu-user-cert-"$name" -i "$dest_p12"