mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 22:40:57 -05:00
devenv options
This commit is contained in:
parent
eb6493192f
commit
af32e7a267
4 changed files with 66 additions and 8 deletions
|
|
@ -1 +1,3 @@
|
||||||
|
export DIRENV_WARN_TIMEOUT=20s
|
||||||
|
|
||||||
use flake
|
use flake
|
||||||
|
|
|
||||||
10
templates/rde/.gitignore
vendored
10
templates/rde/.gitignore
vendored
|
|
@ -7,3 +7,13 @@ devenv.local.nix
|
||||||
|
|
||||||
# pre-commit
|
# pre-commit
|
||||||
.pre-commit-config.yaml
|
.pre-commit-config.yaml
|
||||||
|
|
||||||
|
# Devenv
|
||||||
|
.devenv*
|
||||||
|
devenv.local.nix
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|
||||||
|
# pre-commit
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
|
|
||||||
12
templates/rde/flake.lock
generated
12
templates/rde/flake.lock
generated
|
|
@ -20,11 +20,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756653911,
|
"lastModified": 1756689834,
|
||||||
"narHash": "sha256-3mtwO3Dh3zD/1ubNQHgJuhoLAbxq0BMCS02hMqmJKrk=",
|
"narHash": "sha256-U0+MEMsvR4DNv7zKi/3kPt4NvSvYcUCMwfMTblqNIec=",
|
||||||
"owner": "dwinkler1",
|
"owner": "dwinkler1",
|
||||||
"repo": "nixCatsConfig",
|
"repo": "nixCatsConfig",
|
||||||
"rev": "f83b5dd42bcfbcca40a6f905d7abd9eaaca09e3a",
|
"rev": "fb459451e290fa0a31d7fb096209993a8b18b765",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -50,11 +50,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1756536218,
|
"lastModified": 1756636162,
|
||||||
"narHash": "sha256-ynQxPVN2FIPheUgTFhv01gYLbaiSOS7NgWJPm9LF9D0=",
|
"narHash": "sha256-mBecwgUTWRgClJYqcF+y4O1bY8PQHqeDpB+zsAn+/zA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a918bb3594dd243c2f8534b3be01b3cb4ed35fd1",
|
"rev": "37ff64b7108517f8b6ba5705ee5085eac636a249",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
### Always enable when R is enabled
|
### Always enable when R is enabled
|
||||||
### You can use your own R installation and just enable the plugin
|
### You can use your own R installation and just enable the plugin
|
||||||
gitPlugins = enabledLanguages.r;
|
gitPlugins = enabledLanguages.r;
|
||||||
|
## Create additional dev shells in the project
|
||||||
|
devenv = false;
|
||||||
};
|
};
|
||||||
theme = rec {
|
theme = rec {
|
||||||
## set colortheme and background here
|
## set colortheme and background here
|
||||||
|
|
@ -217,6 +219,16 @@
|
||||||
# OS
|
# OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Devenv
|
||||||
|
.devenv*
|
||||||
|
devenv.local.nix
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.direnv
|
||||||
|
|
||||||
|
# pre-commit
|
||||||
|
.pre-commit-config.yaml
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -244,12 +256,31 @@
|
||||||
echo "✅ Julia dependencies updated"
|
echo "✅ Julia dependencies updated"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f "devenv.nix" ]]; then
|
||||||
|
devenv update
|
||||||
|
echo "✅ Devenv dependencies updated"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "🎉 All dependencies updated!"
|
echo "🎉 All dependencies updated!"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
activateDevenv = ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
if [[ -f "devenv.nix" ]]; then
|
||||||
|
echo "🚀 Activating devenv environment..."
|
||||||
|
exec ${config.defaultPackageName}-devenv shell
|
||||||
|
else
|
||||||
|
echo "❌ No devenv.nix file found in the current directory."
|
||||||
|
echo "To create one, run '${config.defaultPackageName}-initDevenv'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
initPython = prev.writeShellScriptBin "initPython" initPython;
|
initPython = prev.writeShellScriptBin "initPython" initPython;
|
||||||
initProject = prev.writeShellScriptBin "initProject" initProjectScript;
|
initProject = prev.writeShellScriptBin "initProject" initProjectScript;
|
||||||
updateDeps = prev.writeShellScriptBin "updateDeps" updateDepsScript;
|
updateDeps = prev.writeShellScriptBin "updateDeps" updateDepsScript;
|
||||||
|
activateDevenv = prev.writeShellScriptBin "activateDevenv" activateDevenv;
|
||||||
};
|
};
|
||||||
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
|
forSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
|
||||||
projectConfig = forSystems (
|
projectConfig = forSystems (
|
||||||
|
|
@ -509,12 +540,24 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
initDevenv = {
|
initDevenv = {
|
||||||
enable = true;
|
enable = config.enabledPackages.devenv;
|
||||||
path = {
|
path = {
|
||||||
value = "${pkgs.devenv}/bin/devenv";
|
value = "${pkgs.devenv}/bin/devenv";
|
||||||
args = ["--add-flags" "init"];
|
args = ["--add-flags" "init"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
activateDevenv = {
|
||||||
|
enable = config.enabledPackages.devenv;
|
||||||
|
path = {
|
||||||
|
value = "${pkgs.activateDevenv}/bin/activateDevenv";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
devenv = {
|
||||||
|
enable = config.enabledPackages.devenv;
|
||||||
|
path = {
|
||||||
|
value = "${pkgs.devenv}/bin/devenv";
|
||||||
|
};
|
||||||
|
};
|
||||||
updateDeps = {
|
updateDeps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
path = {
|
path = {
|
||||||
|
|
@ -556,6 +599,8 @@
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-marimo: Launch Marimo notebook")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-marimo: Launch Marimo notebook")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-py: Launch IPython REPL")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-py: Launch IPython REPL")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-initPython: Init python project")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-initPython: Init python project")
|
||||||
|
(pkgs.lib.optionalString config.enabledPackages.devenv " - ${config.defaultPackageName}-initDevenv: Init devenv project")
|
||||||
|
(pkgs.lib.optionalString config.enabledPackages.devenv " - ${config.defaultPackageName}-devenv: Run devenv")
|
||||||
" "
|
" "
|
||||||
"To adjust options run: ${config.defaultPackageName} flake.nix"
|
"To adjust options run: ${config.defaultPackageName} flake.nix"
|
||||||
]);
|
]);
|
||||||
|
|
@ -563,7 +608,6 @@
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
name = config.defaultPackageName;
|
name = config.defaultPackageName;
|
||||||
packages = [projectConfig.${system}.default];
|
packages = [projectConfig.${system}.default];
|
||||||
nativeBuildInputs = with pkgs; [devenv];
|
|
||||||
inputsFrom = [];
|
inputsFrom = [];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -579,6 +623,8 @@
|
||||||
echo "${shellCmds}"
|
echo "${shellCmds}"
|
||||||
echo "=========================================================================="
|
echo "=========================================================================="
|
||||||
echo ""
|
echo ""
|
||||||
|
${pkgs.lib.optionalString config.enabledPackages.devenv "${config.defaultPackageName}-activateDevenv"}
|
||||||
|
echo ""
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue