diff --git a/flake.lock b/flake.lock index c6ce9e8..471ca20 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1756886854, - "narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=", + "lastModified": 1758070117, + "narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0e6684e6c5755325f801bda1751a8a4038145d7d", + "rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d1d770b..cfad560 100644 --- a/flake.nix +++ b/flake.nix @@ -3,83 +3,97 @@ inputs.nixpkgs.url = "nixpkgs/nixos-25.05"; - outputs = { self, nixpkgs, ... }@inputs: - let - pkgs = nixpkgs.legacyPackages.x86_64-linux; - start = - pkgs.writeShellScriptBin "start" '' - set -e - export NIXPKGS_ALLOW_INSECURE=1 - 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: { - froide-govplan = super.froide-govplan.overrideAttrs (oldAttrs: rec { - src = ./.; - postInstall = oldAttrs.postInstall + '' - rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates - ln -sf /var/lib/froide-govplan/templates $out/${pkgs.python3.sitePackages}/froide_govplan/templates - cp -r froide_govplan/static $out/${pkgs.python3.sitePackages}/froide_govplan/ - ''; - }); - - pythonPackagesExtensions = super.pythonPackagesExtensions ++ [ - ( - python-final: python-prev: { - moto = python-prev.moto.overridePythonAttrs (oldAttrs: { doCheck = false; }); - } - ) - ]; - + outputs = + { self, nixpkgs, ... }@inputs: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + start = pkgs.writeShellScriptBin "start" '' + set -e + export NIXPKGS_ALLOW_INSECURE=1 + 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: { + froide-govplan = super.froide-govplan.overrideAttrs (oldAttrs: rec { + src = ./.; + postInstall = oldAttrs.postInstall + '' + rm -r $out/${pkgs.python3.sitePackages}/froide_govplan/templates + ln -sf /var/lib/froide-govplan/templates $out/${pkgs.python3.sitePackages}/froide_govplan/templates + cp -r froide_govplan/static $out/${pkgs.python3.sitePackages}/froide_govplan/ + ''; + }); + pythonPackagesExtensions = super.pythonPackagesExtensions ++ [ + (python-final: python-prev: { + moto = python-prev.moto.overridePythonAttrs (oldAttrs: { + doCheck = false; + }); + }) + ]; }) + ]; + }; + modules = [ + ( + { + lib, + config, + pkgs, + ... + }: + { + + virtualisation = { + memorySize = 8000; + diskSize = 4096; + cores = 4; + }; + + disabledModules = [ "services/web-apps/froide-govplan.nix" ]; + + imports = [ ./froide-govplan.nix ]; + + services.froide-govplan = { + enable = true; + package = pkgs.froide-govplan; + settings = { + DEBUG = lib.mkForce true; + CSRF_TRUSTED_ORIGINS = [ "http://localhost:8080" ]; + }; + }; + + nixos-shell.mounts.extraMounts = { + "/var/lib/froide-govplan/templates" = { + target = /home/onny/projects/verwaltungstracker/froide_govplan/templates; + cache = "none"; + }; + }; + + system.stateVersion = "25.05"; + services.getty.autologinUser = "root"; + } + ) ]; }; - modules = [ - ({ lib, config, pkgs, ... }: { - virtualisation = { - memorySize = 8000; - diskSize = 4096; - cores = 4; - }; + devShells.x86_64-linux.default = pkgs.mkShell { + packages = [pkgs.python3Packages.mastodon-py ] ++ pkgs.froide-govplan.dependencies; + shellHook = '' + export GDAL_LIBRARY_PATH="${pkgs.gdal}/lib/libgdal.so" + export GEOS_LIBRARY_PATH="${pkgs.geos}/lib/libgeos_c.so" + ''; + }; - disabledModules = [ "services/web-apps/froide-govplan.nix" ]; + packages = { inherit start; }; + defaultPackage.x86_64-linux = start; - imports = [ ./froide-govplan.nix ]; - - services.froide-govplan = { - enable = true; - package = pkgs.froide-govplan; - settings = { - DEBUG = lib.mkForce true; - CSRF_TRUSTED_ORIGINS = [ "http://localhost:8080" ]; - }; - }; - - nixos-shell.mounts.extraMounts = { - "/var/lib/froide-govplan/templates" = { - target = /home/onny/projects/verwaltungstracker/froide_govplan/templates; - cache = "none"; - }; - }; - - system.stateVersion = "25.05"; - services.getty.autologinUser = "root"; - }) - ]; }; - - packages = { inherit start; }; - defaultPackage.x86_64-linux = start; - - }; } -