django init
This commit is contained in:
commit
b0429003cd
10 changed files with 279 additions and 0 deletions
36
flake.nix
Normal file
36
flake.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
outputs = { self, nixpkgs, ... }: let
|
||||
app = pkgs: let
|
||||
pkg = env.pkgs.buildPythonPackage {
|
||||
pname = "r24";
|
||||
version = "0.1";
|
||||
pyproject = true;
|
||||
src = ./.;
|
||||
dontWrapPythonPrograms = true;
|
||||
|
||||
propagatedBuildInputs = with env.pkgs; [
|
||||
setuptools
|
||||
django
|
||||
];
|
||||
};
|
||||
env = pkgs.python3.withPackages (_: [ pkg ]);
|
||||
wrapper = pkgs.writeShellScript "r24" ''
|
||||
exec ${env.interpreter} ${pkg.outPath}/bin/"''$(basename "''${0}")" "''${@}"
|
||||
'';
|
||||
result = pkgs.runCommand "r24" { buildInputs = [ pkg ]; } ''
|
||||
mkdir -p ''${out}/bin
|
||||
for x in ${pkg}/bin/*; do
|
||||
[[ -x ''${x} ]] || continue
|
||||
ln -sf ${wrapper} ''${out}/bin/''${x##*/}
|
||||
done
|
||||
'';
|
||||
in result;
|
||||
|
||||
packages = system: pkgs: {
|
||||
r24 = app pkgs;
|
||||
};
|
||||
in {
|
||||
packages = builtins.mapAttrs packages nixpkgs.legacyPackages;
|
||||
defaultPackage = builtins.mapAttrs (_: pkgs: pkgs.r24) self.packages;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue