add flake dev shell

This commit is contained in:
Jonas Heinrich 2025-09-19 13:48:32 +02:00
parent af31ea1abb
commit c56689893b
2 changed files with 87 additions and 73 deletions

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1756886854, "lastModified": 1758070117,
"narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=", "narHash": "sha256-uLwwHFCZnT1c3N3biVe/0hCkag2GSrf9+M56+Okf+WY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0e6684e6c5755325f801bda1751a8a4038145d7d", "rev": "e9b7f2ff62b35f711568b1f0866243c7c302028d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,17 +3,18 @@
inputs.nixpkgs.url = "nixpkgs/nixos-25.05"; inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
outputs = { self, nixpkgs, ... }@inputs: outputs =
{ self, nixpkgs, ... }@inputs:
let let
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
start = start = pkgs.writeShellScriptBin "start" ''
pkgs.writeShellScriptBin "start" ''
set -e set -e
export NIXPKGS_ALLOW_INSECURE=1 export NIXPKGS_ALLOW_INSECURE=1
export QEMU_NET_OPTS="hostfwd=tcp::8080-:80" export QEMU_NET_OPTS="hostfwd=tcp::8080-:80"
${pkgs.nixos-shell}/bin/nixos-shell --flake . ${pkgs.nixos-shell}/bin/nixos-shell --flake .
''; '';
in { in
{
nixosConfigurations.vm = nixpkgs.lib.nixosSystem { nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs.inputs = inputs; specialArgs.inputs = inputs;
@ -30,20 +31,25 @@
}); });
pythonPackagesExtensions = super.pythonPackagesExtensions ++ [ pythonPackagesExtensions = super.pythonPackagesExtensions ++ [
( (python-final: python-prev: {
python-final: python-prev: { moto = python-prev.moto.overridePythonAttrs (oldAttrs: {
moto = python-prev.moto.overridePythonAttrs (oldAttrs: { doCheck = false; }); doCheck = false;
} });
) })
]; ];
}) })
]; ];
}; };
modules = [ modules = [
({ lib, config, pkgs, ... }: { (
{
lib,
config,
pkgs,
...
}:
{
virtualisation = { virtualisation = {
memorySize = 8000; memorySize = 8000;
@ -73,13 +79,21 @@
system.stateVersion = "25.05"; system.stateVersion = "25.05";
services.getty.autologinUser = "root"; services.getty.autologinUser = "root";
}) }
)
]; ];
}; };
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"
'';
};
packages = { inherit start; }; packages = { inherit start; };
defaultPackage.x86_64-linux = start; defaultPackage.x86_64-linux = start;
}; };
} }