From ad63f6f0df114af586fdf34fa325ef103981a240 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Wed, 1 Jan 2025 16:51:00 +0100 Subject: [PATCH] init new template --- Makefile | 2 +- flake.lock | 26 ++++++++ flake.nix | 65 +++++++++++++++++++ ...tmarketing.php => heinrichmalerbetrieb.php | 0 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix rename vtdirektmarketing.php => heinrichmalerbetrieb.php (100%) diff --git a/Makefile b/Makefile index e70922d..cd08b73 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ install: mkdir -p $(DESTDIR) - cp vtdirektmarketing.php $(DESTDIR)/ + cp heinrichmalerbetrieb.php $(DESTDIR)/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1d293d7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1735531152, + "narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..035f772 --- /dev/null +++ b/flake.nix @@ -0,0 +1,65 @@ +{ + description = "Invoiceplane invoice template development shell"; + + inputs.nixpkgs.url = "nixpkgs/nixos-24.11"; + + outputs = { self, nixpkgs, ... }@inputs: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + start = + pkgs.writeShellScriptBin "start" '' + set -e + export QEMU_NET_OPTS="hostfwd=tcp::8080-:80" + ${pkgs.nixos-shell}/bin/nixos-shell --flake . + ''; + in { + nixosConfigurations.vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs.inputs = inputs; + pkgs = import nixpkgs { + overlays = [ + (self: super: { + invoiceplane = super.invoiceplane.overrideAttrs (oldAttrs: rec { + installPhase = oldAttrs.installPhase + '' + rm -r $out/application/views/invoice_templates/pdf + ln -sf /var/lib/invoiceplane/localhost/pdf $out/application/views/invoice_templates/pdf + ''; + }); + }) + ]; + }; + modules = [ + ({ lib, config, pkgs, ... }: { + + services.invoiceplane.sites."localhost" = { + enable = true; + settings.IP_URL = "http://localhost:8080"; + }; + + nixos-shell.mounts.extraMounts = { + "/var/lib/invoiceplane/localhost/pdf" = { + target = /home/onny/projects/invoiceplane-heinrichmalerbetrieb; + cache = "none"; + }; + }; + + system.stateVersion = "24.11"; + services.getty.autologinUser = "root"; + documentation = { + info.enable = false; + man.enable = false; + nixos.enable = false; + }; + nix = { + registry.nixpkgs.flake = inputs.nixpkgs; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + }) + ]; + }; + + packages = { inherit start; }; + defaultPackage.x86_64-linux = start; + + }; +} diff --git a/vtdirektmarketing.php b/heinrichmalerbetrieb.php similarity index 100% rename from vtdirektmarketing.php rename to heinrichmalerbetrieb.php