jupyter works through uv command in devenv shell
This commit is contained in:
32
README.md
32
README.md
@@ -1,15 +1,21 @@
|
||||
NixOS Configuration for AppDaemon Development
|
||||
# NixOS Configuration for AppDaemon Development
|
||||
|
||||
Needs a `git.nix` file. Example below:
|
||||
## Objectives
|
||||
|
||||
```shell
|
||||
{ ... }:
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
extraConfig.credential.helper = "store --file ~/.git-credentials";
|
||||
userName = "John Lancaster";
|
||||
userEmail = "32917998+jsl12@users.noreply.github.com";
|
||||
};
|
||||
}
|
||||
```
|
||||
- Use flakes
|
||||
- `devenv`-based workflow
|
||||
- Shell
|
||||
- Build
|
||||
- SSH remote with VSCode
|
||||
- Jupyter through VSCode
|
||||
- `autoreload` must work with editable install of the dev version
|
||||
|
||||
## Usage
|
||||
|
||||
### `nfs`
|
||||
|
||||
Used to rebuild the ad-nix system.
|
||||
|
||||
### `ads`
|
||||
|
||||
Used to enter the development shell. Be careful, as this will create a `.devenv` directory and venv wherever it's entered.
|
||||
@@ -16,6 +16,8 @@ in
|
||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
sops.defaultSopsFile = ./secrets/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
sops.age.keyFile = "${userSettings.adHome}/.config/sops/age/keys.txt";
|
||||
|
||||
27
flake.nix
27
flake.nix
@@ -72,6 +72,7 @@
|
||||
];
|
||||
};
|
||||
|
||||
# https://devenv.sh/guides/using-with-flakes/#the-flakenix-file
|
||||
packages.${systemSettings.system} = {
|
||||
devenv-up = self.devShells.${systemSettings.system}.default.config.procfileScript;
|
||||
devenv-test = self.devShells.${systemSettings.system}.default.config.test;
|
||||
@@ -87,16 +88,19 @@
|
||||
({ pkgs, config, ... }: {
|
||||
# This is your devenv configuration
|
||||
|
||||
# https://devenv.sh/reference/options/#pre-commithooks
|
||||
pre-commit.hooks = {
|
||||
end-of-file-fixer.enable = true;
|
||||
trim-trailing-whitespace.enable = true;
|
||||
};
|
||||
|
||||
# https://devenv.sh/supported-languages/python/
|
||||
languages.python = {
|
||||
enable = true;
|
||||
version = systemSettings.pythonVersion;
|
||||
uv = {
|
||||
enable = true;
|
||||
package = pkgs.uv;
|
||||
sync = {
|
||||
enable = true;
|
||||
allExtras = true;
|
||||
@@ -107,20 +111,19 @@
|
||||
|
||||
packages = with pkgs; [
|
||||
git
|
||||
# (writeShellScriptBin "full-build" ''
|
||||
# cd ${adPath}
|
||||
# ${pkgs.uv}/bin/uv build --wheel
|
||||
# docker build -t acockburn/appdaemon:local-dev ${adPath}
|
||||
# '')
|
||||
# (pkgs.python312.withPackages (python-pkgs: with python-pkgs; [
|
||||
# pip
|
||||
# setuptools
|
||||
# wheel
|
||||
# ipykernel
|
||||
# rich
|
||||
# ]))
|
||||
(pkgs.python312.withPackages (python-pkgs: with python-pkgs; [
|
||||
pip
|
||||
setuptools
|
||||
wheel
|
||||
notebook
|
||||
rich
|
||||
]))
|
||||
];
|
||||
|
||||
processes = {
|
||||
my-jup.exec = "uv run jupyter notebook";
|
||||
};
|
||||
|
||||
enterShell = ''
|
||||
alias appdaemon="${pkgs.uv}/bin/uv run --frozen python -m appdaemon"
|
||||
alias ad="appdaemon"
|
||||
|
||||
Reference in New Issue
Block a user