Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_jump_image_iter, fix tqdm #44

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 62 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,64 @@
{
description = "A collection of flake templates";

outputs = { self }: {
templates = {
portrait = {
path = ./libs/jump_portrait;
description = "JUMP portrait development template";
};

};

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
}
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = forEachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
});
devShells = forEachSystem
(system:
let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
mpkgs = import inputs.nixpkgs_master {
system = system;
config.allowUnfree = true;
};
in
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
stdenv = pkgs.clangStdenv;
env.NIX_LD = nixpkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
env.NIX_LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath (with pkgs; [
# Add needed packages here
pkgs.libz # for numpy
pkgs.stdenv.cc.cc
pkgs.libGL
]);
# https://devenv.sh/reference/options/
packages = with pkgs; [
poetry
python311
ruff
pyright
];
enterShell = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
if [ ! -d ".venv" ]; then
poetry install -vv --with dev --no-root
fi
source .venv/bin/activate
'';
}
];
};
});
};
2 changes: 1 addition & 1 deletion libs/jump_babel/.envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake . --impure
use flake . --impure --accept-flake-config
2 changes: 1 addition & 1 deletion libs/jump_portrait/.envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake .
use flake . --impure
131 changes: 6 additions & 125 deletions libs/jump_portrait/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 56 additions & 49 deletions libs/jump_portrait/flake.nix
Original file line number Diff line number Diff line change
@@ -1,62 +1,69 @@

{
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.follows = "dream2nix/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
};

outputs = { self, nixpkgs, devenv, systems, dream2nix, ... } @ inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let

pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};

mpkgs = import inputs.nixpkgs_master {
system = system;
config.allowUnfree = true;
};
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
packages = forEachSystem (system: {
devenv-up = self.devShells.${system}.default.config.procfileScript;
});

in {
devShells =
devShells = forEachSystem
(system:
let
python_with_pkgs = (pkgs.python310.withPackages(pp: []));
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};

mpkgs = import inputs.nixpkgs_master {
system = system;
config.allowUnfree = true;
};
in
with pkgs;
{
default = pkgs.mkShell {
NIX_LD = runCommand "ld.so" {} ''
ln -s "$(cat '${pkgs.stdenv.cc}/nix-support/dynamic-linker')" $out
'';
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.zlib
];
packages = [
mpkgs.rye
uv
];
venvDir = "./.venv";
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
shellHook = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:"${pkgs.stdenv.cc.cc.lib}/lib"
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
runHook venvShellHook
export PYTHONPATH=${python_with_pkgs}/${python_with_pkgs.sitePackages}:$PYTHONPATH
rye sync
source .venv/bin/activate
'';
};
{
default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
stdenv = pkgs.clangStdenv;
env.NIX_LD = nixpkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
env.NIX_LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath (with pkgs; [
# Add needed packages here
pkgs.libz # for numpy
pkgs.stdenv.cc.cc
pkgs.libGL
]);
# https://devenv.sh/reference/options/
packages = with pkgs; [
poetry
ruff
python310
];
enterShell = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
if [ ! -d ".venv" ]; then
poetry install -vv --with dev
fi
source .venv/bin/activate
'';
}
];
};
}
);
});
};
}
Loading