File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,23 @@ export async function restoreCache({
80
80
} ) {
81
81
let extraTarArgs : string [ ] = [ ] ;
82
82
83
- if ( ! lookupOnly ) {
84
- const nixPaths = readdirSync ( "/nix/store" ) . map (
85
- x => `../../../../../nix/store/${ x } `
86
- ) ;
83
+ if ( inputs . nix && ! lookupOnly ) {
84
+ const excludePaths = readdirSync ( "/nix/store" )
85
+ . map ( x => `../../../../../nix/store/${ x } ` )
86
+ . concat (
87
+ readdirSync ( "/nix/var/nix" )
88
+ . filter ( x => x != "db" )
89
+ . map ( x => `../../../../../nix/var/nix/${ x } ` )
90
+ )
91
+ . concat (
92
+ readdirSync ( "/nix/var/nix/db" )
93
+ . filter ( x => x != "db.sqlite" )
94
+ . map ( x => `../../../../../nix/var/nix/db/${ x } ` )
95
+ ) ;
96
+
87
97
const tmp = await cacheUtils . createTempDirectory ( ) ;
88
98
const excludeFromFile = `${ tmp } /nix-store-paths` ;
89
- writeFileSync ( excludeFromFile , nixPaths . join ( "\n" ) ) ;
99
+ writeFileSync ( excludeFromFile , excludePaths . join ( "\n" ) ) ;
90
100
extraTarArgs = [ "--exclude-from" , excludeFromFile ] ;
91
101
92
102
info ( `::group::Logs produced while restoring a cache.` ) ;
You can’t perform that action at this time.
0 commit comments