-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use niv for dependency management. this follows our own tutorials on writing packages and development shells, and we generally find it is easier to read and work with. Co-authored-by: Alejandro Sanchez Medina <[email protected]>
- Loading branch information
1 parent
8c657ff
commit 97a1a23
Showing
9 changed files
with
295 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,69 @@ | ||
(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { | ||
src = builtins.fetchGit ./.; | ||
}).defaultNix | ||
{ inputs ? import ./nix/sources.nix }: | ||
let | ||
pkgs = import inputs.nixpkgs { | ||
config = { }; | ||
overlays = [ (import ./overlay.nix) ]; | ||
}; | ||
|
||
nix-dev = pkgs.stdenv.mkDerivation { | ||
name = "nix-dev"; | ||
src = ./.; | ||
nativeBuildInputs = with pkgs.python310.pkgs; [ | ||
linkify-it-py | ||
myst-parser | ||
sphinx | ||
sphinx-book-theme | ||
sphinx-copybutton | ||
sphinx-design | ||
sphinx-notfound-page | ||
sphinx-sitemap | ||
]; | ||
buildPhase = '' | ||
make html | ||
''; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -R build/html/* $out/ | ||
''; | ||
}; | ||
|
||
devmode = | ||
let | ||
pythonEnvironment = pkgs.python310.withPackages (ps: with ps; [ | ||
livereload | ||
]); | ||
script = '' | ||
from livereload import Server, shell | ||
server = Server() | ||
build_docs = shell("make html") | ||
print("Doing an initial build of the docs...") | ||
build_docs() | ||
server.watch("source/*", build_docs) | ||
server.watch("source/**/*", build_docs) | ||
server.watch("_templates/*.html", build_docs) | ||
server.serve(root="build/html") | ||
''; | ||
in | ||
pkgs.writeShellApplication { | ||
name = "devmode"; | ||
runtimeInputs = [ pythonEnvironment ]; | ||
text = '' | ||
python ${pkgs.writeText "live.py" script} | ||
''; | ||
}; | ||
in | ||
{ | ||
packages.default = nix-dev; | ||
|
||
devShells.default = pkgs.mkShell { | ||
inputsFrom = [ nix-dev ]; | ||
packages = with pkgs.python310.pkgs; [ | ||
black | ||
devmode | ||
]; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"nixpkgs": { | ||
"branch": "nixos-23.05", | ||
"description": "Nix Packages collection & NixOS", | ||
"homepage": "", | ||
"owner": "NixOS", | ||
"repo": "nixpkgs", | ||
"rev": "898cb2064b6e98b8c5499f37e81adbdf2925f7c5", | ||
"sha256": "0ha53gbglrcnpzfc4lwzgyvlsagvm1m2q9z5i5b4nfahplnqpsbj", | ||
"type": "tarball", | ||
"url": "https://github.com/NixOS/nixpkgs/archive/898cb2064b6e98b8c5499f37e81adbdf2925f7c5.tar.gz", | ||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
}, | ||
"poetry2nix": { | ||
"branch": "master", | ||
"description": "Convert poetry projects to nix automagically [maintainer=@adisbladis] ", | ||
"homepage": "", | ||
"owner": "nix-community", | ||
"repo": "poetry2nix", | ||
"rev": "fe0dcb4c9b44162a385f1170895fe6a392ed71b5", | ||
"sha256": "0cxccm7hzcmizhbg79rdqimjndin98waibw824cmgzwwqkyzl9lv", | ||
"type": "tarball", | ||
"url": "https://github.com/nix-community/poetry2nix/archive/fe0dcb4c9b44162a385f1170895fe6a392ed71b5.tar.gz", | ||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
} | ||
} |
Oops, something went wrong.