File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 5757 fetcher = nix . fetcher or "native" ; # native doesn't exist yet
5858 conf = config . fetcher or { } ;
5959 f = conf . ${ fetcher } or { } ;
60- root = f . root or "npins" ;
60+ fetchRoot = f . root or "npins" ;
6161 in
6262 if fetcher == "npins" then
6363 let
64- pins = import ( dirOf path + "/${ root } " ) ;
64+ pins = import ( dirOf path + "/${ fetchRoot } " ) ;
6565 in
6666 mod . filterMap (
6767 k : v :
8989 ) config . fetch or { }
9090 # else if fetcher = "native", etc
9191 else
92- { } ;
92+ let
93+ lockPath = "${ root } /${ src } .lock" ;
94+ lock = builtins . fromTOML ( builtins . readFile lockPath ) ;
95+ in
96+ if builtins . pathExists lockPath && lock . version == 1 then
97+ builtins . listToAttrs (
98+ map ( dep : {
99+ inherit ( dep ) name ;
100+ value =
101+ let
102+ path = "${ root } /${ dep . path } @.toml" ;
103+ in
104+ if dep ? version && dep ? path && builtins . pathExists path then
105+ ( import ./importAtom.nix ) { } path
106+ else if dep ? rev then
107+ let
108+ repo = builtins . fetchGit {
109+ inherit ( dep ) url rev ;
110+ shallow = true ;
111+ } ;
112+ in
113+ import repo
114+ else
115+ { } ;
116+ } ) lock . deps
117+ )
118+ else
119+ { } ;
93120
94121 meta = atom . meta or { } ;
95122
Original file line number Diff line number Diff line change 2626 stdFilter
2727 stdToml
2828 coreToml
29+ importAtom
2930 ;
3031
3132 path = {
You can’t perform that action at this time.
0 commit comments