mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 22:40:57 -05:00
Refactor template: extract scripts, overlays, and hosts into separate modules
Co-authored-by: dwinkler1 <22460147+dwinkler1@users.noreply.github.com>
This commit is contained in:
parent
5e8f07c560
commit
3398a72241
17 changed files with 1185 additions and 422 deletions
34
templates/rde/hosts/julia.nix
Normal file
34
templates/rde/hosts/julia.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Julia-related host configurations
|
||||
config: pkgs: {
|
||||
jl = {
|
||||
enable = config.enabledLanguages.julia;
|
||||
path = {
|
||||
value = "${pkgs.julia-bin}/bin/julia";
|
||||
args = ["--add-flags" "--project=."];
|
||||
};
|
||||
};
|
||||
|
||||
initJl = {
|
||||
enable = config.enabledLanguages.julia;
|
||||
path = {
|
||||
value = "${pkgs.julia-bin}/bin/julia";
|
||||
args = ["--add-flags" "--project=. -e 'using Pkg; Pkg.instantiate(); Pkg.add(\"Pluto\")'"];
|
||||
};
|
||||
};
|
||||
|
||||
pluto = let
|
||||
runPluto = ''
|
||||
import Pkg; import TOML; Pkg.instantiate();
|
||||
if !isfile("Project.toml") || !haskey(TOML.parsefile(Base.active_project())["deps"], "Pluto")
|
||||
Pkg.add("Pluto");
|
||||
end
|
||||
import Pluto; Pluto.run();
|
||||
'';
|
||||
in {
|
||||
enable = config.enabledLanguages.julia;
|
||||
path = {
|
||||
value = "${pkgs.julia-bin}/bin/julia";
|
||||
args = ["--add-flags" "--project=. -e '${runPluto}'"];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue