File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ lib ,
4+ pkgs ,
5+ ...
6+ } :
7+
8+ let
9+ cfg = config . programs . autoenv ;
10+ in
11+ {
12+ options = {
13+ programs . autoenv = {
14+ enable = lib . mkEnableOption "autoenv" ;
15+ package = lib . mkPackageOption pkgs "autoenv" { } ;
16+ } ;
17+ } ;
18+
19+ config = lib . mkIf cfg . enable {
20+ environment . systemPackages = [ pkgs . autoenv ] ;
21+
22+ programs = {
23+ zsh . interactiveShellInit = ''
24+ source ${ cfg . package } /share/autoenv/activate.sh
25+ '' ;
26+
27+ bash . interactiveShellInit = ''
28+ source ${ cfg . package } /share/autoenv/activate.sh
29+ '' ;
30+ } ;
31+ } ;
32+ }
Original file line number Diff line number Diff line change 1+ {
2+ stdenv ,
3+ fetchFromGitHub ,
4+ lib ,
5+ } :
6+
7+ stdenv . mkDerivation ( finalAttrs : {
8+ pname = "autoenv" ;
9+ version = "0-unstable-2024-10-16" ;
10+
11+ src = fetchFromGitHub {
12+ owner = "hyperupcall" ;
13+ repo = "autoenv" ;
14+ rev = "90241f182d6a7c96e9de8a25c1eccaf2a2d1b43a" ;
15+ hash = "sha256-vZrsMPhuu+xPVAww04nKyoOl7k0upvpIaxeMrCikDio=" ;
16+ } ;
17+
18+ dontBuild = true ;
19+
20+ installPhase = ''
21+ runHook preInstall
22+ mkdir -p $out/share
23+ cp -R $src $out/share/autoenv
24+ chmod +x $out/share/autoenv
25+ runHook postInstall
26+ '' ;
27+
28+ meta = {
29+ description = "Per-directory shell environments sourced from .env file" ;
30+ homepage = "https://github.com/hyperupcall/autoenv" ;
31+ license = lib . licenses . mit ;
32+ platforms = lib . platforms . all ;
33+ maintainers = with lib . maintainers ; [ clebs ] ;
34+ } ;
35+ } )
You can’t perform that action at this time.
0 commit comments