commit e4b72a232df69e8b8a8f16db4beb807cb99a8a5d
parent 0464d076c0d7e72a7a1342be81e41e86ef3ba026
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date: Mon, 8 Dec 2025 19:11:38 +0100
Change Makefile to support NixOS
Diffstat:
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,18 +1,25 @@
src = $(wildcard *.sh) $(wildcard *.py)
obj = $(patsubst %,$(dest)/%,$(basename $(src)))
-dest = /usr/local/bin
+ifeq ($(origin out), environment)
+ dest = $(out)/bin
+else
+ dest = /usr/local/bin
+endif
.PHONY: install uninstall
install: $(obj)
-$(dest)/%: %.sh
+$(dest)/%: %.sh | $(dest)
cp -f $< $@
chmod 755 $@
-$(dest)/%: %.py
+$(dest)/%: %.py | $(dest)
cp -f $< $@
chmod 755 $@
+$(dest):
+ mkdir -p $@
+
uninstall:
rm -f $(obj)
diff --git a/gemini-to-html.py b/gemini-to-html.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Oscar Benedito <oscar@oscarbenedito.com>
# License: Affero General Public License version 3 or later