Skip to content
Snippets Groups Projects
Commit 42111721 authored by Tom Prince's avatar Tom Prince
Browse files

Use `tools/default.nix` for tools.

parent dbd18ac5
No related branches found
No related tags found
2 merge requests!180merge develop into production,!165Add a script to update nixos version, and run it.
......@@ -49,7 +49,7 @@ To update the version of NixOS we deploy with, run:
.. code: shell
nix-shell --command 'tools/update-nixpkgs'
nix-shell --command 'update-nixpkgs'
That will update ``nixpkgs-2015.json`` to the latest release on the nixos-21.05 channel.
......
......@@ -3,25 +3,14 @@ let
in
{ pkgs ? release2105, lib ? pkgs.lib, python ? pkgs.python3 }:
let
# This is a python envionment that has the dependencies
# for the development python scripts we use, and the
# helper library.
python-env = python.buildEnv.override {
extraLibs = [ python.pkgs.httpx ];
# Add `.pth` file pointing at the directory containg our helper library.
# This will get added to `sys.path` by `site.py`.
# See https://docs.python.org/3/library/site.html
postBuild = ''
echo ${lib.escapeShellArg ./tools/pylib} > $out/${lib.escapeShellArg python.sitePackages}/tools.pth
'';
};
tools = pkgs.callPackage ./tools {};
in
pkgs.mkShell {
shellHook = ''
export NIX_PATH="nixpkgs=${pkgs.path}";
'';
buildInputs = [
python-env
tools
pkgs.morph
pkgs.jp
];
......
{ pkgs, lib, makeWrapper, ... }:
let
python = pkgs.python3;
# This is a python envionment that has the dependencies
# for the development python scripts we use, and the
# helper library.
python-env = python.buildEnv.override {
extraLibs = [ python.pkgs.httpx ];
# Add `.pth` file pointing at the directory containg our helper library.
# This will get added to `sys.path` by `site.py`.
# See https://docs.python.org/3/library/site.html
postBuild = ''
echo ${lib.escapeShellArg ./pylib} > $out/${lib.escapeShellArg python.sitePackages}/tools.pth
'';
};
in
# This derivation creates a package that wraps our tools to setup an environment
# with there dependencies available.
pkgs.runCommand "ps_tools" {
nativeBuildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
# makeWrapper <executable> <wrapperfile> <args>
# See https://nixos.org/manual/nixpkgs/stable/#fun-makeWrapper
makeWrapper ${python-env}/bin/python $out/bin/update-nixpkgs --add-flags ${toString ./update-nixpkgs}
''
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment