add flake dev shell
This commit is contained in:
parent
af31ea1abb
commit
c56689893b
2 changed files with 87 additions and 73 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -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": {
|
||||
|
|
|
|||
42
flake.nix
42
flake.nix
|
|
@ -3,17 +3,18 @@
|
|||
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
start =
|
||||
pkgs.writeShellScriptBin "start" ''
|
||||
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 {
|
||||
in
|
||||
{
|
||||
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs.inputs = inputs;
|
||||
|
|
@ -30,20 +31,25 @@
|
|||
});
|
||||
|
||||
pythonPackagesExtensions = super.pythonPackagesExtensions ++ [
|
||||
(
|
||||
python-final: python-prev: {
|
||||
moto = python-prev.moto.overridePythonAttrs (oldAttrs: { doCheck = false; });
|
||||
}
|
||||
)
|
||||
(python-final: python-prev: {
|
||||
moto = python-prev.moto.overridePythonAttrs (oldAttrs: {
|
||||
doCheck = false;
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
|
||||
|
||||
})
|
||||
];
|
||||
};
|
||||
modules = [
|
||||
({ lib, config, pkgs, ... }: {
|
||||
(
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
virtualisation = {
|
||||
memorySize = 8000;
|
||||
|
|
@ -73,13 +79,21 @@
|
|||
|
||||
system.stateVersion = "25.05";
|
||||
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; };
|
||||
defaultPackage.x86_64-linux = start;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue