Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heizung
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3pb
Heizung
Commits
6d4e6c17
Commit
6d4e6c17
authored
1 year ago
by
Benjamin Koch
Browse files
Options
Downloads
Patches
Plain Diff
refactor devShells: default shell contains kibot+rust, now
parent
629f1aca
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flake.nix
+61
-42
61 additions, 42 deletions
flake.nix
with
61 additions
and
42 deletions
flake.nix
+
61
−
42
View file @
6d4e6c17
...
...
@@ -116,48 +116,67 @@
kibot
=
flake-utils
.
lib
.
mkApp
{
drv
=
self
.
packages
.
${
system
}
.
kibot
;
};
default
=
kibot
;
};
devShells
.
default
=
with
self
.
packages
.
${
system
};
pkgs
.
mkShell
{
packages
=
[
(
python3
.
withPackages
(
p
:
[
kibot
]))
kibot
];
shellHook
=
''
# KiAuto wants to run stuff inside xvfb so let's make sure that we don't leak windows to our Wayland desktop.
unset WAYLAND_DISPLAY
# The Kicad package puts several paths into environment variables but only in the wrapper script.
# KiAuto needs some of them, e.g. to find footprint that are available locally.
source
${
kicad-vars
}
# Fix crash in Gtk save dialog, e.g. start eeschema, open ERC window, click save.
# https://github.com/NixOS/nixpkgs/issues/149812#issuecomment-1004387735
export XDG_DATA_DIRS="
${
pkgs
.
gtk3
}
/share/gsettings-schemas/
${
pkgs
.
gtk3
.
name
}
:$XDG_DATA_DIRS"
# The interposer causes a crash and KiBot doesn't seem to have any way to disable it or pass extra parameters to
# eeschema_do but we can disable it with an environment variable.
export KIAUTO_INTERPOSER_DISABLE=1
# Cache 3d models
# -> README says that the default is not to cache but in fact it uses a sensible default.
#if [ -z "$KIBOT_3D_MODELS" ] ; then
# if [ -n "$XDG_CACHE_HOME" ] ; then
# export KIBOT_3D_MODELS="$XDG_CACHE_HOME/kibot/3d"
# else
# export KIBOT_3D_MODELS="$HOME/.cache/kibot/3d"
# fi
# if ! mkdir -p "$KIBOT_3D_MODELS" ; then
# echo "WARN: I cannot create the cache directory for 3D models so they won't be cached."
# unset KIBOT_3D_MODELS
# fi
#fi
''
;
};
devShells
.
rust
=
with
self
.
packages
.
${
system
};
pkgs
.
mkShell
{
packages
=
with
pkgs
;
[
rustup
udev
.
dev
pkg-config
openssl
.
dev
picotool
(
self
.
packages
.
${
system
}
.
python3
.
withPackages
(
p
:
with
p
;
[
pymodbus3
pyserial
modbus-tk
]))
];
devShells
=
let
flakePkgs
=
self
.
packages
.
${
system
};
in
rec
{
kibot
=
with
flakePkgs
;
pkgs
.
mkShell
rec
{
passthru
.
packages
=
[
flakePkgs
.
kibot
];
passthru
.
pythonPackages
=
p
:
[
flakePkgs
.
kibot
];
packages
=
passthru
.
packages
++
[
(
python3
.
withPackages
passthru
.
pythonPackages
)
];
shellHook
=
''
# KiAuto wants to run stuff inside xvfb so let's make sure that we don't leak windows to our Wayland desktop.
unset WAYLAND_DISPLAY
# The Kicad package puts several paths into environment variables but only in the wrapper script.
# KiAuto needs some of them, e.g. to find footprint that are available locally.
source
${
kicad-vars
}
# Fix crash in Gtk save dialog, e.g. start eeschema, open ERC window, click save.
# https://github.com/NixOS/nixpkgs/issues/149812#issuecomment-1004387735
export XDG_DATA_DIRS="
${
pkgs
.
gtk3
}
/share/gsettings-schemas/
${
pkgs
.
gtk3
.
name
}
:$XDG_DATA_DIRS"
# The interposer causes a crash and KiBot doesn't seem to have any way to disable it or pass extra parameters to
# eeschema_do but we can disable it with an environment variable.
export KIAUTO_INTERPOSER_DISABLE=1
# Cache 3d models
# -> README says that the default is not to cache but in fact it uses a sensible default.
#if [ -z "$KIBOT_3D_MODELS" ] ; then
# if [ -n "$XDG_CACHE_HOME" ] ; then
# export KIBOT_3D_MODELS="$XDG_CACHE_HOME/kibot/3d"
# else
# export KIBOT_3D_MODELS="$HOME/.cache/kibot/3d"
# fi
# if ! mkdir -p "$KIBOT_3D_MODELS" ; then
# echo "WARN: I cannot create the cache directory for 3D models so they won't be cached."
# unset KIBOT_3D_MODELS
# fi
#fi
''
;
};
rust
=
with
flakePkgs
;
pkgs
.
mkShell
rec
{
passthru
.
packages
=
with
pkgs
;
[
rustup
udev
.
dev
pkg-config
openssl
.
dev
picotool
];
passthru
.
pythonPackages
=
p
:
with
p
;
[
pymodbus3
pyserial
modbus-tk
];
packages
=
passthru
.
packages
++
[
(
python3
.
withPackages
passthru
.
pythonPackages
)
];
};
default
=
pkgs
.
mkShell
{
#packages = kibot.nativeBuildInputs ++ rust.nativeBuildInputs;
packages
=
kibot
.
passthru
.
packages
++
rust
.
passthru
.
packages
++
[
(
flakePkgs
.
python3
.
withPackages
(
p
:
kibot
.
passthru
.
pythonPackages
p
++
rust
.
passthru
.
pythonPackages
p
))
];
shellHook
=
kibot
.
shellHook
;
};
};
}
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment